DynAdjust
Loading...
Searching...
No Matches
dynadjust::networkadjust::dna_adjust Class Reference

#include <dnaadjust.hpp>

Collaboration diagram for dynadjust::networkadjust::dna_adjust:
Collaboration graph

Public Member Functions

 dna_adjust ()
 
virtual ~dna_adjust ()
 
void ShrinkForwardMatrices (const UINT32 currentBlock)
 
void CarryForwardJunctions (const UINT32 currentBlock, const UINT32 nextBlock)
 
bool CarryReverseJunctions (const UINT32 currentBlock, const UINT32 nextBlock, bool MT_ReverseOrCombine)
 
void PrepareAdjustmentMultiThread ()
 
void PrepareAdjustmentBlock (const UINT32 block, const UINT32 thread_id=0)
 
bool PrepareAdjustmentReverse (const UINT32 block, bool MT_ReverseOrCombine)
 
bool PrepareAdjustmentCombine (const UINT32 block, UINT32 &pseudomsrJSLCount, bool MT_ReverseOrCombine)
 
void BackupNormals (const UINT32 block, bool MT_ReverseOrCombine)
 
void UpdateEstimatesForward (const UINT32 block)
 
void UpdateEstimatesReverse (const UINT32 block, bool MT_ReverseOrCombine)
 
void UpdateEstimatesCombine (const UINT32 block, UINT32 prevJSLCount)
 
void UpdateEstimatesFinal (const UINT32 currentBlock)
 
void UpdateEstimatesFinalNoCombine ()
 
void GenerateStatistics ()
 
void PrepareAdjustment (const project_settings &adjustmentSettings)
 
void CancelAdjustment ()
 
bool IsCancelled () const
 
_ADJUST_STATUS_ GetStatus () const
 
bool IsPreparing ()
 
bool IsAdjusting ()
 
bool ExceptionRaised ()
 
void PrintAdjustedNetworkStations ()
 
void PrintPositionalUncertainty ()
 
void PrintNetworkStationCorrections ()
 
void PrintAdjustedNetworkMeasurements ()
 
void PrintMeasurementsToStation ()
 
bool PrintEstimatedStationCoordinatestoSNX (std::string &sinex_file)
 
void PrintEstimatedStationCoordinatestoDNAXML (const std::string &stnFile, INPUT_FILE_TYPE t, bool flagUnused=false)
 
void PrintEstimatedStationCoordinatestoDNAXML_Y (const std::string &msrFile, INPUT_FILE_TYPE t)
 
void CloseOutputFiles ()
 
void UpdateBinaryFiles ()
 
UINT32 CurrentIteration () const
 
UINT32incrementIteration ()
 
void initialiseIteration (const UINT32 &iteration=0)
 
UINT32 CurrentBlock () const
 
void SetcurrentBlock (const UINT32 b)
 
void SetmaxCorr (const double c)
 
UINT32 blockCount () const
 
boost::posix_time::milliseconds adjustTime () const
 
bool processingForward ()
 
bool processingCombine ()
 
int GetDegreesOfFreedom () const
 
UINT32 GetMeasurementCount () const
 
UINT32 GetUnknownsCount () const
 
double GetChiSquared () const
 
double GetSigmaZero () const
 
UINT32 GetPotentialOutlierCount () const
 
double GetChiSquaredUpperLimit () const
 
double GetChiSquaredLowerLimit () const
 
double GetGlobalPelzerRel () const
 
UINT32 GetTestResult () const
 
bool GetAllFixed () const
 
void GetMemoryFootprint (double &memory, const _MEM_UNIT_ unit)
 
void LoadSegmentationFileParameters (const std::string &seg_filename)
 
void SerialiseAdjustedVarianceMatrices ()
 
void DeSerialiseAdjustedVarianceMatrices ()
 
bool NewMessagesAvailable ()
 
bool GetMessageIteration (UINT32 &iteration)
 
std::string GetMaxCorrection (const UINT32 &iteration) const
 
void ThreadSafeWritetoAdjFile (const std::string &s)
 
void WriteStatstoAdjFile (const std::string &s)
 
void WriteStntoAdjFile (const std::string &s)
 
void WriteMsrtoAdjFile (const std::string &s)
 
void ThreadSafeWritetoDbgFile (const std::string &s)
 
_ADJUST_STATUS_ AdjustNetwork ()
 
bool FirstBlock (const UINT32 &block) const
 
bool LastBlock (const UINT32 &block) const
 
void SignalExceptionAdjustment (const std::string &msg, const UINT32 block_no)
 
void CreateMeasurementTally (const UINT32 &block=0)
 
void SolveTry (bool COMPUTE_INVERSE, const UINT32 &block=0)
 
void SolveMTTry (bool COMPUTE_INVERSE, const UINT32 &block=0)
 
void Solve (bool COMPUTE_INVERSE, const UINT32 &block=0)
 
void SolveMT (bool COMPUTE_INVERSE, const UINT32 &block)
 
bool CombineRequired (const UINT32 &block) const
 

Public Attributes

concurrent_ofstream< std::string > concurrent_adj_ofstream
 
bool isPreparing_
 
bool isAdjusting_
 
bool isCombining_
 
bool forward_
 
bool isFirstTimeAdjustment_
 
bool isIterationComplete_
 
bool isAdjustmentQuestionable_
 
UINT32 blockCount_
 
UINT32 currentBlock_
 
boost::posix_time::milliseconds total_time_
 
_ADJUST_STATUS_ adjustStatus_
 
vstring statusMessages_
 
UINT32 currentIteration_
 
std::vector< blockMeta_tv_blockMeta_
 

Private Member Functions

 dna_adjust (const dna_adjust &)
 
dna_adjustoperator= (const dna_adjust &)
 
bool InitialiseandValidateMsrPointer (const it_vUINT32 &_it_block_msr, it_vmsr_t &_it_msr)
 
bool InitialiseMeasurement (pit_vmsr_t _it_msr, bool buildnewMatrices)
 
void RebuildNormals (const UINT32 block, adjustOperation direction, bool AddConstraintStationstoNormals, bool BackupNormals)
 
void UpdateAdjustment (bool iterate)
 
void ValidateandFinaliseAdjustment (boost::timer::cpu_timer &tot_time)
 
void PrintAdjustmentStatus ()
 
void PrintAdjustmentTime (boost::timer::cpu_timer &time, _TIMER_TYPE_)
 
void PrintIteration (const UINT32 &iteration)
 
void InitialiseAdjustment ()
 
void SetDefaultReferenceFrame ()
 
void LoadNetworkFiles ()
 
void CreateMsrToStnTally ()
 
void AdjustSimultaneous ()
 
void AdjustPhased ()
 
void AdjustPhasedForward ()
 
void AdjustPhasedReverseCombine ()
 
bool CombinationThreadRequired ()
 
void AdjustPhasedMultiThread ()
 
void AdjustPhasedBlock1 ()
 
void AdjustPhasedReverse ()
 
void ApplyAdditionalConstraints ()
 
void AddDiscontinuitySites (vstring &constraintStns)
 
void LoadStationMap (pv_string_uint32_pair stnsMap, const std::string &stnmap_file)
 
void ResizeMatrixVectors ()
 
void LoadPhasedBlocks ()
 
void LoadSegmentationFile ()
 
void LoadSegmentationMetrics ()
 
void RemoveInvalidISLStations (vUINT32 &v_ISLTemp)
 
void RemoveNonMeasurements (const UINT32 &block)
 
void RemoveDuplicateStations (vUINT32 &vStns)
 
void InitialiseTypeBUncertainties ()
 
void SortMeasurementsbyType (v_uint32_u32u32_pair &msr_block)
 
void SortMeasurementsbyFromStn (v_uint32_u32u32_pair &msr_block)
 
void SortMeasurementsbyToStn (v_uint32_u32u32_pair &msr_block)
 
void SortMeasurementsbyValue (v_uint32_u32u32_pair &msr_block)
 
void SortMeasurementsbyResidual (v_uint32_u32u32_pair &msr_block)
 
void SortMeasurementsbyAdjSD (v_uint32_u32u32_pair &msr_block)
 
void SortMeasurementsbyNstat (v_uint32_u32u32_pair &msr_block)
 
void SortStationsbyFileOrder (vUINT32 &v_blockStations)
 
void SortStationsbyID (vUINT32 &v_blockStations)
 
void SetRegionOffsets (const UINT32 &block, const int file_count=0,...)
 
void SetRegionOffset (vmat_file_map &file_map)
 
void SetMapRegions (const int file_count=0,...)
 
void PrepareMemoryMapRegions (const UINT32 &block, const int file_count=0,...)
 
void OffloadBlockToDisk (const UINT32 &block)
 
void OffloadBlockToMappedFile (const UINT32 &block)
 
void SerialiseBlockToDisk (const UINT32 &block)
 
void SerialiseBlockToMappedFile (const UINT32 &block, const int file_count=0,...)
 
void DeserialiseBlockFromMappedFile (const UINT32 &block, const int count=0,...)
 
void UnloadBlock (const UINT32 &block, const int file_count=0,...)
 
void PurgeMatricesFromDisk ()
 
void AddMsrtoMeasMinusComp (pit_vmsr_t _it_msr, const UINT32 &design_row, const double comp_msr, matrix_2d *measMinusComp, bool printBlock=true)
 
void AddMsrtoNormalsVar (const UINT32 &design_row, const UINT32 &stn, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void AddMsrtoNormalsCoVar2 (const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void AddMsrtoNormalsCoVar3 (const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void AddMsrtoDesign (const UINT32 &design_row, const UINT32 &stn, const double &dmdx, const double &dmdy, const double &dmdz, matrix_2d *design)
 
void AddMsrtoDesign_L (const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, const double dmdx1, const double dmdy1, const double dmdz1, const double dmdx2, const double dmdy2, const double dmdz2, matrix_2d *design)
 
void AddMsrtoDesign_BCEKMSVZ (const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, const double dmdx, const double dmdy, const double dmdz, matrix_2d *design)
 
void AddElementtoDesign (const UINT32 &row, const UINT32 &col, const double value, matrix_2d *design)
 
void UpdateDesignNormalMeasMatrices (pit_vmsr_t _it_msr, UINT32 &design_row, bool buildnewMatrices, const UINT32 &block, bool MT_ReverseOrCombine)
 
void UpdateDesignNormalMeasMatrices_A (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_BK (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_C (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_CEM (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_D (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_E (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignMeasMatrices_GX (pit_vmsr_t _it_msr, UINT32 &design_row, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *design, const UINT32 &stn1, const UINT32 &stn2, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_G (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_H (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_HR (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_I (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_IP (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_J (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_JQ (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_L (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_M (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_P (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_Q (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_R (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_S (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_V (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_X (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_Y (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
void UpdateDesignNormalMeasMatrices_Z (pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
 
bool IgnoredMeasurementContainsInvalidStation (pit_vmsr_t _it_msr)
 
void UpdateIgnoredMeasurements (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_A (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_B (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_BK (pit_vmsr_t _it_msr)
 
void UpdateIgnoredMeasurements_C (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_CEM (pit_vmsr_t _it_msr)
 
void UpdateIgnoredMeasurements_D (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_E (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_G (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_GX (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_H (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_HR (pit_vmsr_t _it_msr)
 
void UpdateIgnoredMeasurements_I (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_IP (pit_vmsr_t _it_msr)
 
void UpdateIgnoredMeasurements_J (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_JQ (pit_vmsr_t _it_msr)
 
void UpdateIgnoredMeasurements_K (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_L (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_M (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_P (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_Q (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_R (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_S (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_V (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_X (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_Y (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void UpdateIgnoredMeasurements_Z (pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
 
void LoadVarianceScaling (it_vmsr_t _it_msr, double &vScale, double &pScale, double &lScale, double &hScale, bool &scaleMatrix, bool &scalePartial)
 
void LoadVarianceMatrix_D (it_vmsr_t _it_msr, matrix_2d *var_dirn, bool buildnewMatrices)
 
void LoadVarianceMatrix_G (it_vmsr_t _it_msr, matrix_2d *var_cart)
 
void LoadVarianceMatrix_X (it_vmsr_t _it_msr, matrix_2d *var_cart)
 
void LoadVarianceMatrix_Y (it_vmsr_t _it_msr, matrix_2d *var_cart, const _COORD_TYPE_ coordType)
 
void PrintMsrVarianceMatrixException (const it_vmsr_t &_it_msr, const std::runtime_error &e, std::stringstream &ss, const std::string &calling_function, const UINT32 msr_count=0)
 
void PrepareStationandVarianceMatrices (const UINT32 &block)
 
void PrepareMappedRegions (const UINT32 &block)
 
void PopulateEstimatedStationMatrix (const UINT32 &block, UINT32 &unknownParams)
 
void CarryStnEstimatesandVariancesForward (const UINT32 &thisBlock, const UINT32 &nextBlock)
 
void CarryStnEstimatesandVariancesReverse (const UINT32 &nextBlock, const UINT32 &thisBlock, bool MT_ReverseOrCombine)
 
void CarryStnEstimatesandVariancesCombine (const UINT32 &nextBlock, const UINT32 &thisBlock, UINT32 &pseudomsrJSLCount, bool MT_ReverseOrCombine)
 
void UpdateAtVinv (pit_vmsr_t _it_msr, const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, UINT32 &design_row, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices=true)
 
void UpdateAtVinv_D (const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, const UINT32 &angle, const UINT32 &angle_count, UINT32 &design_row, UINT32 &design_row_begin, matrix_2d *Vinv, matrix_2d *design, matrix_2d *AtVinv)
 
void UpdateNormals (const UINT32 &block, bool MT_ReverseOrCombine)
 
void UpdateNormals_A (const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void UpdateNormals_BCEKLMSVZ (const UINT32 &stn1, const UINT32 &stn2, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void UpdateNormals_HIJPQR (const UINT32 &stn1, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void UpdateNormals_D (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void UpdateNormals_G (const UINT32 &stn1, const UINT32 &stn2, UINT32 &design_row, matrix_2d *normals, matrix_2d *AtVinv)
 
void UpdateNormals_X (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
 
void UpdateNormals_Y (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, matrix_2d *normals, matrix_2d *AtVinv)
 
void OutputLargestCorrection (std::string &formatted_msg)
 
void PrepareDesignAndMsrMnsCmpMatrices (const UINT32 &block)
 
void PrepareDesignAndMsrMnsCmpMatricesStage (const UINT32 &block)
 
void FillDesignNormalMeasurementsMatrices (bool buildnewMatrices, const UINT32 &block, bool MT_ReverseOrCombine)
 
void AddConstraintStationstoNormalsForward (const UINT32 &block)
 
void AddConstraintStationstoNormalsReverse (const UINT32 &block, bool MT_ReverseOrCombine)
 
void AddConstraintStationstoNormalsCombine (const UINT32 &block, bool MT_ReverseOrCombine)
 
void AddConstraintStationstoNormalsSimultaneous (const UINT32 &block)
 
void FormConstraintStationVarianceMatrix (const it_vUINT32 &_it_param_stn, matrix_2d &var_cart)
 
void UpdateNormalsR (const UINT32 &block)
 
void UpdateNormalsC (const UINT32 &block)
 
void CarryStnEstimatesandVariancesReverseR (const UINT32 &nextBlock, const UINT32 &thisBlock)
 
void ComputeStatistics ()
 
void ComputeStatisticsOnIteration ()
 
void ComputeTstatistics ()
 
void UpdateMsrTstatistic (const UINT32 &block=0)
 
void UpdateMsrTstatistic_D (it_vmsr_t &_it_msr)
 
void UpdateMsrTstatistic_GXY (it_vmsr_t &_it_msr)
 
void ComputeandPrintAdjMsrOnIteration ()
 
void ComputeandPrintAdjMsrBlockOnIteration (const UINT32 &block, v_uint32_u32u32_pair msr_block, bool printHeader)
 
void ComputeAdjMsrBlockOnIteration (const UINT32 &block)
 
void ComputeAdjustedMsrPrecisions ()
 
void ComputeChiSquareNetwork ()
 
void ComputeChiSquare (const UINT32 &block)
 
void ComputeChiSquareSimultaneous ()
 
void ComputeChiSquarePhased (const UINT32 &block)
 
void ComputeTestStat (const double &dof, double &chiUpper, double &chiLower, double &sigmaZero, UINT32 &passFail)
 
void ComputeBlockTestStat (const UINT32 &block)
 
void ComputeGlobalTestStat ()
 
void ComputeGlobalNetStat ()
 
void ComputePrecisionAdjMsrs (const UINT32 &block=0)
 
void ComputePrecisionAdjMsrs_A (const UINT32 &block, const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
 
void ComputePrecisionAdjMsrs_D (const UINT32 &block, it_vmsr_t &_it_msr, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
 
void ComputePrecisionAdjMsrs_BCEKLMSVZ (const UINT32 &block, const UINT32 &stn1, const UINT32 &stn2, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
 
void ComputePrecisionAdjMsrs_HIJPQR (const UINT32 &block, const UINT32 &stn1, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
 
void ComputePrecisionAdjMsrs_GX (const UINT32 &block, it_vmsr_t &_it_msr, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
 
void ComputePrecisionAdjMsrs_Y (const UINT32 &block, it_vmsr_t &_it_msr, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
 
void UpdateMsrRecords (const UINT32 &block=0)
 
void UpdateMsrRecord (const UINT32 &block, it_vmsr_t &_it_msr, const UINT32 &msr_row, const UINT32 &precadjmsr_row, const double &measPrec)
 
void UpdateMsrRecords_D (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &msr_row, UINT32 &precadjmsr_row)
 
void UpdateMsrRecords_GXY (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &msr_row, UINT32 &precadjmsr_row)
 
void UpdateMsrRecordStats (it_vmsr_t &_it_msr, const double &measPrec)
 
void ComputeGlobalPelzer ()
 
void ComputeGlobalPelzer_D (it_vmsr_t &_it_msr, UINT32 &numMsr, double &sum)
 
void ComputeGlobalPelzer_GXY (it_vmsr_t &_it_msr, UINT32 &numMsr, double &sum)
 
void ComputeChiSquare_ABCEHIJKLMPQRSVZ (const it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)
 
void ComputeChiSquare_D (it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)
 
void ComputeChiSquare_G (const it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)
 
void ComputeChiSquare_XY (const it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)
 
void FormInverseVarianceMatrix (matrix_2d *vmat, bool LOWER_IS_CLEARED=false)
 
void FormInverseGPSVarianceMatrix (const it_vmsr_t &_it_msr, matrix_2d *vmat)
 
bool FormInverseVarianceMatrixReduced (it_vmsr_t _it_msr, matrix_2d *var_cart, const std::string &method_name)
 
void PrintStatistics (bool printPelzer=true)
 
void OpenOutputFileStreams ()
 
void PrintOutputFileHeaderInfo ()
 
void PrintCompMeasurements (const UINT32 &block, const std::string &msg="")
 
void PrintCompMeasurementsAngular (const char cardinal, const double &computed, const double &correction, const it_vmsr_t &_it_msr)
 
void PrintCompMeasurementsLinear (const char cardinal, const double &computed, const double &correction, const it_vmsr_t &_it_msr)
 
void PrintCompMeasurements_A (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
 
void PrintCompMeasurements_CELMS (it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
 
void PrintCompMeasurements_D (it_vmsr_t &_it_msr, UINT32 &design_row, bool printIgnored=false)
 
void PrintCompMeasurements_HR (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
 
void PrintCompMeasurements_IJPQ (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
 
void PrintCompMeasurements_BKVZ (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
 
void PrintCompMeasurements_GXY (const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
 
void PrintCompMeasurements_YLLH (it_vmsr_t &_it_msr, UINT32 &design_row)
 
void PrintMeasurementsAngular (const char cardinal, const double &measurement, const double &correction, const it_vmsr_t &_it_msr, bool printAdjMsr=true)
 
void PrintMeasurementsLinear (const char cardinal, const double &measurement, const double &correction, const it_vmsr_t &_it_msr, bool printAdjMsr=true)
 
void PrintMeasurementCorrection (const char cardinal, const it_vmsr_t &_it_msr)
 
void PrintMeasurementDatabaseID (const it_vmsr_t &_it_msr, bool initialise_dbindex=true)
 
void FormUniqueMsrList ()
 
void PrintAdjMeasurementsHeader (bool printHeader, const std::string &table_heading, printMeasurementsMode printMode, UINT32 block, bool printBlocks=false)
 
void PrintAdjMeasurements (v_uint32_u32u32_pair msr_block, bool printHeader)
 
void PrintAdjMeasurementsAngular (const char cardinal, const it_vmsr_t &_it_msr, bool initialise_dbindex=true)
 
void PrintAdjMeasurementsLinear (const char cardinal, const it_vmsr_t &_it_msr, bool initialise_dbindex=true)
 
void PrintAdjGNSSAlternateUnits (it_vmsr_t &_it_msr, const uint32_uint32_pair &b_pam)
 
void PrintAdjMeasurementStatistics (const char cardinal, const it_vmsr_t &_it_msr, bool initialise_dbindex=true)
 
void PrintIgnoredAdjMeasurements (bool printHeader)
 
void PrintAdjMeasurements_A (it_vmsr_t &_it_msr)
 
void PrintAdjMeasurements_CELMS (it_vmsr_t &_it_msr)
 
void PrintAdjMeasurements_D (it_vmsr_t &_it_msr)
 
void PrintAdjMeasurements_HR (it_vmsr_t &_it_msr)
 
void PrintAdjMeasurements_IJPQ (it_vmsr_t &_it_msr)
 
void PrintAdjMeasurements_BKVZ (it_vmsr_t &_it_msr)
 
void PrintAdjMeasurements_GXY (it_vmsr_t &_it_msr, const uint32_uint32_pair &b_pam)
 
void PrintAdjMeasurements_YLLH (it_vmsr_t &_it_msr)
 
void ReduceYLLHMeasurementsforPrinting (vmsr_t &y_msr, matrix_2d &mpositions, printMeasurementsMode print_mode)
 
void PrintAdjStation (std::ostream &os, const UINT32 &block, const UINT32 &stn, const UINT32 &mat_idx, const matrix_2d *stationEstimates, matrix_2d *stationVariances, bool recomputeGeographicCoords, bool updateGeographicCoords, bool reapplyTypeBUncertainties)
 
void PrintAdjStations (std::ostream &os, const UINT32 &block, const matrix_2d *stationEstimates, matrix_2d *stationVariances, bool printBlockID, bool recomputeGeographicCoords, bool updateGeographicCoords, bool printHeader, bool reapplyTypeBUncertainties)
 
void PrintAdjStationsUniqueList (std::ostream &os, const v_mat_2d *stationEstimates, v_mat_2d *stationVariances, bool recomputeGeographicCoords, bool updateGeographicCoords, bool reapplyTypeBUncertainties)
 
void PrintCorStations (std::ostream &cor_file, const UINT32 &block)
 
void PrintCorStationsUniqueList (std::ostream &cor_file)
 
void PrintCorStation (std::ostream &os, const UINT32 &block, const UINT32 &stn, const UINT32 &mat_idx, const matrix_2d *stationEstimates)
 
void PrintPosUncertainty (std::ostream &os, const UINT32 &block, const UINT32 &stn, const UINT32 &mat_idx, const matrix_2d *stationVariances, const UINT32 &map_idx=0, const vUINT32 *blockStations=NULL)
 
void PrintPosUncertainties (std::ostream &os, const UINT32 &block, const matrix_2d *stationVariances)
 
void PrintPosUncertaintiesUniqueList (std::ostream &os, const v_mat_2d *stationVariances)
 
void PrintPosUncertaintiesHeader (std::ostream &os)
 
void UpdateGeographicCoordsPhased (const UINT32 &block, matrix_2d *estimatedStations)
 
void UpdateGeographicCoords ()
 
UINT32 GetBlkMatrixElemStn1 (const UINT32 &block, const pit_vmsr_t _it_msr)
 
UINT32 GetBlkMatrixElemStn2 (const UINT32 &block, const pit_vmsr_t _it_msr)
 
UINT32 GetBlkMatrixElemStn3 (const UINT32 &block, const pit_vmsr_t _it_msr)
 
void debug_BlockInformation (const UINT32 &currentBlock, const std::string &adjustment_method)
 
void debug_SolutionInformation (const UINT32 &currentBlock)
 
void BuildUniqueBlockStationMap ()
 
void BuildSimultaneousStnAppearance ()
 
void OpenStageFileStreams (const int file_count=0,...)
 
void ReserveBlockMapRegions (const int file_count=0,...)
 
void CloseStageFileStreams ()
 
void LoadDatabaseId ()
 

Static Private Member Functions

static void fillSinexExample ()
 

Private Attributes

CDnaDatum datum_
 
CDnaProjection projection_
 
double _var_C
 
double _var_F
 
matrix_2d _inv_var_cart_c
 
matrix_2d _inv_var_cart_f
 
project_settings projectSettings_
 
binary_file_meta_t bst_meta_
 
binary_file_meta_t bms_meta_
 
vstn_t bstBinaryRecords_
 
vmsr_t bmsBinaryRecords_
 
vASL vAssocStnList_
 
v_aml_pair vAssocMsrList_
 
UINT32 bmsr_count_
 
UINT32 bstn_count_
 
UINT32 asl_count_
 
std::ofstream debug_file
 
std::ofstream adj_file
 
std::ofstream xyz_file
 
UINT32 blockLargeCorr_
 
double largestCorr_
 
UINT16 PRECISION_SEC_MSR
 
UINT16 PRECISION_SEC_STN
 
UINT16 PRECISION_MTR_MSR
 
UINT16 PRECISION_MTR_STN
 
UINT32 measurementParams_
 
UINT32 measurementCount_
 
UINT32 unknownParams_
 
UINT32 unknownsCount_
 
double chiSquared_
 
double chiSquaredStage_
 
double sigmaZero_
 
double sigmaZeroSqRt_
 
double chiSquaredUpperLimit_
 
double chiSquaredLowerLimit_
 
double globalPelzerReliability_
 
int degreesofFreedom_
 
UINT32 passFail_
 
double maxCorr_
 
double criticalValue_
 
UINT32 potentialOutlierCount_
 
bool allStationsFixed_
 
message_bank< std::string > iterationCorrections_
 
vUINT32 v_ContiguousNetList_
 
vsummary_t v_statSummary_
 
vUINT32 v_pseudoMeasCountFwd_
 
vUINT32 v_measurementParams_
 
vUINT32 v_measurementCount_
 
vUINT32 v_measurementVarianceCount_
 
vUINT32 v_unknownParams_
 
vUINT32 v_unknownsCount_
 
vdouble v_sigmaZero_
 
vdouble v_chiSquaredUpperLimit_
 
vdouble v_chiSquaredLowerLimit_
 
vUINT32 v_passFail_
 
v_uint32_uint32_map v_blockStationsMap_
 
v_u32u32_uint32_pair v_blockStationsMapUnique_
 
vvUINT32 v_ISL_
 
vvUINT32 v_JSL_
 
vvUINT32 v_CML_
 
v_uint32_u32u32_pair v_msr_block_
 
vmsrtally v_msrTally_
 
vmsrtally v_stnmsrTally_
 
vv_stn_appear v_paramStnAppearance_
 
vUINT32 v_parameterStationCount_
 
vvUINT32 v_parameterStationList_
 
type_b_uncertainty typeBUncertaintyGlobal_
 
v_type_b_uncertainty v_typeBUncertaintiesLocal_
 
v_type_b_method v_typeBUncertaintyMethod_
 
v_uint32_uint32_pair v_stationTypeBMap_
 
v_mat_2d v_normals_
 
v_mat_2d v_normalsR_
 
v_mat_2d v_AtVinv_
 
v_mat_2d v_design_
 
v_mat_2d v_rigorousVariances_
 
v_mat_2d v_measMinusComp_
 
v_mat_2d v_estimatedStations_
 
v_mat_2d v_originalStations_
 
v_mat_2d v_rigorousStations_
 
v_mat_2d v_junctionVariances_
 
v_mat_2d v_junctionVariancesFwd_
 
v_mat_2d v_junctionEstimatesFwd_
 
v_mat_2d v_junctionEstimatesRev_
 
v_mat_2d v_precAdjMsrsFull_
 
v_mat_2d v_corrections_
 
v_mat_2d v_correctionsR_
 
vmat_file_map normals_map_
 
vmat_file_map normalsR_map_
 
vmat_file_map AtVinv_map_
 
vmat_file_map design_map_
 
vmat_file_map measMinusComp_map_
 
vmat_file_map estimatedStations_map_
 
vmat_file_map originalStations_map_
 
vmat_file_map rigorousStations_map_
 
vmat_file_map junctionVariances_map_
 
vmat_file_map junctionVariancesFwd_map_
 
vmat_file_map junctionEstimatesFwd_map_
 
vmat_file_map junctionEstimatesRev_map_
 
vmat_file_map rigorousVariances_map_
 
vmat_file_map precAdjMsrs_map_
 
vmat_file_map corrections_map_
 
vstring v_stageFileStreams_
 
std::fstream f_normals_
 
std::fstream f_normalsR_
 
std::fstream f_AtVinv_
 
std::fstream f_design_
 
std::fstream f_measMinusComp_
 
std::fstream f_estimatedStations_
 
std::fstream f_originalStations_
 
std::fstream f_rigorousStations_
 
std::fstream f_junctionVariances_
 
std::fstream f_junctionVariancesFwd_
 
std::fstream f_junctionEstimatesFwd_
 
std::fstream f_junctionEstimatesRev_
 
std::fstream f_rigorousVariances_
 
std::fstream f_precAdjMsrs_
 
std::fstream f_corrections_
 
concurrent_queue< UINT32iterationQueue_
 
v_mat_2d v_designR_
 
v_mat_2d v_AtVinvR_
 
v_mat_2d v_normalsRC_
 
v_mat_2d v_measMinusCompR_
 
v_mat_2d v_estimatedStationsR_
 
v_mat_2d v_junctionVariancesR_
 
vUINT32 v_blockStationsR
 
v_msr_database_id_map v_msr_db_map_
 
it_vdbid_t _it_dbid
 
bool databaseIDsLoaded_
 
std::atomic< bool > isCancelled_
 

Detailed Description

Definition at line 211 of file dnaadjust.hpp.

Constructor & Destructor Documentation

◆ dna_adjust() [1/2]

dynadjust::networkadjust::dna_adjust::dna_adjust ( )

Definition at line 50 of file dnaadjust.cpp.

51 : isPreparing_(false)
52 , isAdjusting_(false)
53 , isCombining_(false)
54 , forward_(true)
58 , blockCount_(1)
59 , currentBlock_(0)
60 , total_time_(0)
64 , bmsr_count_(0)
65 , bstn_count_(0)
66 , asl_count_(0)
71 , chiSquared_(0.)
72 , sigmaZero_(0.)
73 , sigmaZeroSqRt_(0.)
79 , maxCorr_(0.)
80 , criticalValue_(1.68)
81 , allStationsFixed_(false)
82 , databaseIDsLoaded_(false)
83 , isCancelled_(false)
84{
85 statusMessages_.clear();
86 bstBinaryRecords_.clear();
87 bmsBinaryRecords_.clear();
88 vAssocMsrList_.clear();
89
90 debug_file.clear();
93 v_measurementCount_.clear();
95 v_unknownParams_.clear();
96 v_unknownsCount_.clear();
97 v_sigmaZero_.clear();
100 v_passFail_.clear();
101
102 v_originalStations_.clear();
103 v_design_.clear();
104 v_measMinusComp_.clear();
105
106 v_AtVinv_.clear();
107 v_normals_.clear();
108 v_estimatedStations_.clear();
109 v_rigorousStations_.clear();
110 v_junctionVariances_.clear();
114 v_rigorousVariances_.clear();
115 v_precAdjMsrsFull_.clear();
116 v_corrections_.clear();
117 v_blockStationsMap_.clear();
118
121
122 // multi thread (for reverse and combine passes)
123 v_designR_.clear();
124 v_measMinusCompR_.clear();
125 v_AtVinvR_.clear();
126 v_normalsR_.clear();
127 v_estimatedStationsR_.clear();
128 v_junctionVariancesR_.clear();
129 v_normalsRC_.clear();
130
131#ifdef _MSC_VER
132#if (_MSC_VER < 1900)
133 {
134 // this function is obsolete in MS VC++ 14.0, VS2015
135 // Set scientific format to print two places for the exponent
136 _set_output_format(_TWO_DIGIT_EXPONENT);
137 }
138#endif
139#endif
140
141 // v_correctionsR_ is only used in phased adjustment.
142 // In single thread mode, it holds rigorous corrections
143 // for last block. In multi-thread mode, it is used
144 // for in the reverse thread.
145 switch (projectSettings_.a.adjust_mode)
146 {
147 case PhasedMode:
148 v_correctionsR_.clear();
149 }
150}
v_uint32_uint32_map v_blockStationsMap_
boost::posix_time::milliseconds total_time_
const UINT32 DEFAULT_EPSG_U(GDA2020_i)
@ ADJUST_SUCCESS
@ PhasedMode
@ test_stat_pass
Definition dnatypes.hpp:313

References ADJUST_SUCCESS, adjustStatus_, allStationsFixed_, asl_count_, blockCount_, bmsBinaryRecords_, bmsr_count_, bstBinaryRecords_, bstn_count_, chiSquared_, chiSquaredLowerLimit_, chiSquaredUpperLimit_, criticalValue_, currentBlock_, currentIteration_, databaseIDsLoaded_, datum_, debug_file, DEFAULT_EPSG_U(), degreesofFreedom_, forward_, globalPelzerReliability_, isAdjusting_, isAdjustmentQuestionable_, isCancelled_, isCombining_, isFirstTimeAdjustment_, isIterationComplete_, isPreparing_, maxCorr_, measurementCount_, measurementParams_, passFail_, projectSettings_, sigmaZero_, sigmaZeroSqRt_, statusMessages_, test_stat_pass, total_time_, unknownParams_, unknownsCount_, v_AtVinv_, v_AtVinvR_, v_blockStationsMap_, v_chiSquaredLowerLimit_, v_chiSquaredUpperLimit_, v_corrections_, v_design_, v_designR_, v_estimatedStations_, v_estimatedStationsR_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_junctionVariancesR_, v_measMinusComp_, v_measMinusCompR_, v_measurementCount_, v_measurementParams_, v_measurementVarianceCount_, v_normals_, v_normalsR_, v_normalsRC_, v_originalStations_, v_parameterStationCount_, v_parameterStationList_, v_passFail_, v_precAdjMsrsFull_, v_pseudoMeasCountFwd_, v_rigorousStations_, v_rigorousVariances_, v_sigmaZero_, v_unknownParams_, v_unknownsCount_, and vAssocMsrList_.

Referenced by dna_adjust(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~dna_adjust()

dynadjust::networkadjust::dna_adjust::~dna_adjust ( )
virtual

Definition at line 153 of file dnaadjust.cpp.

154{
156 {
157 try {
158 debug_file.close();
159 }
160 catch (...) { }
161
162 try {
163 adj_file.close();
164 }
165 catch (...) { }
166
167 try {
168 xyz_file.close();
169 }
170 catch (...) { }
171 }
172}
@ ADJUST_EXCEPTION_RAISED

References adj_file, ADJUST_EXCEPTION_RAISED, adjustStatus_, debug_file, and xyz_file.

◆ dna_adjust() [2/2]

dynadjust::networkadjust::dna_adjust::dna_adjust ( const dna_adjust & )
private

References dna_adjust().

Here is the call graph for this function:

Member Function Documentation

◆ operator=()

◆ ShrinkForwardMatrices()

void dynadjust::networkadjust::dna_adjust::ShrinkForwardMatrices ( const UINT32 currentBlock)

Definition at line 3969 of file dnaadjust.cpp.

3970{
3971 UINT32 pseudoMsrElemCount;
3972 if (!v_blockMeta_.at(currentBlock)._blockIsolated && !v_blockMeta_.at(currentBlock)._blockFirst)
3973 {
3974 pseudoMsrElemCount = static_cast<UINT32>(v_JSL_.at(currentBlock-1).size() * 3);
3975
3976 v_measMinusComp_.at(currentBlock).shrink(pseudoMsrElemCount, 0);
3977 v_AtVinv_.at(currentBlock).shrink(0, pseudoMsrElemCount);
3978 }
3979}
std::vector< blockMeta_t > v_blockMeta_
unsigned int UINT32
Definition dnatypes.hpp:50

References v_AtVinv_, v_blockMeta_, v_JSL_, and v_measMinusComp_.

Referenced by AdjustPhasedForward(), and operator=().

Here is the caller graph for this function:

◆ CarryForwardJunctions()

void dynadjust::networkadjust::dna_adjust::CarryForwardJunctions ( const UINT32 currentBlock,
const UINT32 nextBlock )

Definition at line 4025 of file dnaadjust.cpp.

4026{
4027 // If required, print the stations for this block. Geographic coordinates are updated
4028 // only if necessary for output
4029 if (projectSettings_.o._adj_stn_iteration)
4030 {
4031 adj_file_mutex.lock();
4032
4033 if (projectSettings_.a.multi_thread)
4034 {
4035 adj_file << std::endl << "1> Adjusted block " << thisBlock + 1;
4036 if (v_blockMeta_.at(thisBlock)._blockLast || v_blockMeta_.at(thisBlock)._blockIsolated)
4037 adj_file << " (forward, rigorous) " << std::endl;
4038 else
4039 adj_file << " (forward, in isolation) " << std::endl;
4040 }
4041
4042 PrintAdjStations(adj_file, thisBlock,
4043 &v_estimatedStations_.at(thisBlock), &v_normals_.at(thisBlock),
4044 false, true, false, true, false);
4045 adj_file_mutex.unlock();
4046 }
4047
4048 // Carry the estimated junction station coordinates and variances to the next block if
4049 // this block and the next block are both in the same network. Thus, carry data except when:
4050 // - thisBlock is a single block, or
4051 // - nextBlock is a single block, or
4052 // - thisBlock is the last block
4053 if (v_blockMeta_.at(thisBlock)._blockIsolated)
4054 return;
4055 if (v_blockMeta_.at(thisBlock)._blockLast)
4056 return;
4057 if (v_blockMeta_.at(nextBlock)._blockIsolated)
4058 return;
4059
4060 // For staged adjustments, load block info for nextBlock
4061 if (projectSettings_.a.stage)
4062 {
4064 RebuildNormals(nextBlock, __forward__, true, true);
4065 }
4066
4067 CarryStnEstimatesandVariancesForward(thisBlock, nextBlock);
4068}
void DeserialiseBlockFromMappedFile(const UINT32 &block, const int count=0,...)
void CarryStnEstimatesandVariancesForward(const UINT32 &thisBlock, const UINT32 &nextBlock)
void PrintAdjStations(std::ostream &os, const UINT32 &block, const matrix_2d *stationEstimates, matrix_2d *stationVariances, bool printBlockID, bool recomputeGeographicCoords, bool updateGeographicCoords, bool printHeader, bool reapplyTypeBUncertainties)
void RebuildNormals(const UINT32 block, adjustOperation direction, bool AddConstraintStationstoNormals, bool BackupNormals)
@ __forward__
boost::mutex adj_file_mutex
Definition dnaadjust.cpp:43

References __forward__, adj_file, dynadjust::networkadjust::adj_file_mutex, CarryStnEstimatesandVariancesForward(), DeserialiseBlockFromMappedFile(), PrintAdjStations(), projectSettings_, RebuildNormals(), v_blockMeta_, v_estimatedStations_, and v_normals_.

Referenced by AdjustPhasedForward(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CarryReverseJunctions()

bool dynadjust::networkadjust::dna_adjust::CarryReverseJunctions ( const UINT32 currentBlock,
const UINT32 nextBlock,
bool MT_ReverseOrCombine )

Definition at line 4772 of file dnaadjust.cpp.

4773{
4774 // Carrying of junction parameters not required for single blocks, nor
4775 // if this is the first block
4776 if (v_blockMeta_.at(currentBlock)._blockIsolated)
4777 return false;
4778 if (v_blockMeta_.at(currentBlock)._blockFirst)
4779 return false;
4780
4781 // matrices from previous block
4782 matrix_2d* estimatedStationsNext(&v_estimatedStations_.at(nextBlock));
4783
4784 if (MT_ReverseOrCombine)
4785 estimatedStationsNext = &v_estimatedStationsR_.at(nextBlock);
4786 else
4787 {
4788 // Restore back up copy of normals for reverse adjustment in
4789 // single thread mode
4790 if (!projectSettings_.a.stage)
4791 v_normals_.at(nextBlock) = v_normalsR_.at(nextBlock);
4792 }
4793
4794 // For staged adjustments, load blocks info for nextBlock
4795 if (projectSettings_.a.stage)
4797
4798 // Next, update estimates for next block to original estimates
4799 *estimatedStationsNext = v_originalStations_.at(nextBlock);
4800
4801 // For staged adjustments, rebuild design and AtVinv
4802 if (projectSettings_.a.stage)
4803 RebuildNormals(nextBlock, __reverse__, false, false);
4804
4805 // Now, carry the estimated junction station coordinates and variances
4806 // to the next block (to be used in the next loop).
4807 // Remember - the junction station estimates and variances of the next block
4808 // (obtained during the forward pass) were copied during the forward pass
4809 // in CarryStnEstimatesandVariancesForward(..), so no need to back-up prior
4810 // to carrying in reverse.
4811
4812 // copy estimated coordinates and variances for the junction stations from
4813 // this block to the next block (which is nextBlock)
4814 CarryStnEstimatesandVariancesReverse(nextBlock, currentBlock, MT_ReverseOrCombine);
4815
4816 AddConstraintStationstoNormalsReverse(nextBlock, MT_ReverseOrCombine);
4817
4818 return true;
4819}
void CarryStnEstimatesandVariancesReverse(const UINT32 &nextBlock, const UINT32 &thisBlock, bool MT_ReverseOrCombine)
void AddConstraintStationstoNormalsReverse(const UINT32 &block, bool MT_ReverseOrCombine)
@ __reverse__

References __reverse__, AddConstraintStationstoNormalsReverse(), CarryStnEstimatesandVariancesReverse(), DeserialiseBlockFromMappedFile(), projectSettings_, RebuildNormals(), v_blockMeta_, v_estimatedStations_, v_estimatedStationsR_, v_normals_, v_normalsR_, and v_originalStations_.

Referenced by AdjustPhasedReverse(), AdjustPhasedReverseCombine(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareAdjustmentMultiThread()

void dynadjust::networkadjust::dna_adjust::PrepareAdjustmentMultiThread ( )

Definition at line 823 of file dnaadjust-multi.cpp.

824{
826
827 boost::thread mt_prepare_thread(adjust_prepare_thread(this, boost::ref(prep_error)));
828
829 // Start the forward, reverse and combine threads, which commences the
830 // network adjustment
831 mt_prepare_thread.join();
832
833 // Were any exceptions thrown? If so, re-throw and let
834 // test stub handle the exception
835 if (prep_error)
836 // exception thrown in one of the combination adjustments
837 boost::rethrow_exception(prep_error);
838}
boost::exception_ptr prep_error
Definition dnaadjust.cpp:48
concurrent_queue< UINT32 > prepareAdjustmentQueue
Definition dnaadjust.cpp:47

References dynadjust::networkadjust::prep_error, and dynadjust::networkadjust::prepareAdjustmentQueue.

Referenced by operator=(), and PrepareAdjustment().

Here is the caller graph for this function:

◆ PrepareAdjustmentBlock()

void dynadjust::networkadjust::dna_adjust::PrepareAdjustmentBlock ( const UINT32 block,
const UINT32 thread_id = 0 )

Definition at line 3837 of file dnaadjust.cpp.

3838{
3839
3840 if (projectSettings_.a.multi_thread && projectSettings_.g.verbose > 2)
3841 {
3842 adj_file_mutex.lock();
3843 adj_file << thread_id << "> Preparing block " << block + 1 << "..." << std::endl;
3844 adj_file_mutex.unlock();
3845 }
3846
3847 UINT32 i;
3848 it_vUINT32 _it_stn;
3849
3850 if (projectSettings_.g.verbose > 3)
3851 {
3852 debug_file << "BLOCK " << block + 1 << " Station summary -------------------------------------------------" << std::endl;
3853 debug_file << "Stations: ";
3854 for (i=0; i<v_parameterStationList_.at(block).size(); ++i)
3855 {
3856 debug_file << v_parameterStationList_.at(block).at(i);
3857 if ((_it_stn = find(v_ISL_.at(block).begin(), v_ISL_.at(block).end(), v_parameterStationList_.at(block).at(i))) != v_ISL_.at(block).end())
3858 debug_file << "i ";
3859 else if ((_it_stn = find(v_JSL_.at(block).begin(), v_JSL_.at(block).end(), v_parameterStationList_.at(block).at(i))) != v_JSL_.at(block).end())
3860 debug_file << "j ";
3861 else
3862 debug_file << " ";
3863 }
3864 debug_file << " (";
3865 for (i=0; i<v_parameterStationList_.at(block).size(); ++i)
3866 {
3867 if (i>0)
3868 debug_file << ", ";
3869 debug_file << bstBinaryRecords_.at(v_parameterStationList_.at(block).at(i)).stationName;
3870 }
3871 debug_file << ")" << std::endl << std::endl;
3872 }
3873
3874 // Form Estimated Stations matrices. For phased adjustments, matrices
3875 // for junction estimates and variances carried forward and reverse
3876 // are also formed. Initial geographic coordinates are computed also.
3878
3879 // Dimension matrices for design, msr-comp, AtVinv, normals, corrections and
3880 // precision of adjusted msrs. msr-comp and AtVinv have additional elements
3881 // for junction station measurements.
3882 // Form design matrix from observation equations using AddMsrtoNormalandMeasMatrices.
3883 // In this case, the more 'difficult' measurement types are reduced to simpler
3884 // types to allow direct expression of measurements in terms of X, Y, Z.
3885 // For ever iteration thereafter, RecomputeMeasurements... is used
3886
3887 // For phased adjustment, all stations in ISL and JSL are treated as parameters
3888 // to be estimated. The inclusion of all stations is required since:
3889 // "as a consequence of the segmentation algorithm, many blocks
3890 // are formed where there are insufficient connections to datum
3891 // for the section as a whole or, some stations coordinates within
3892 // the section cannot be estimated from the set of measurements
3893 // making up the section."
3894 // (Leahy, PhD thesis, p. 3.21).
3895 //
3896 // To begin with, the number of rows in the block matrices corresponds with the ISL. To facilitate
3897 // the above, rows must be added to all blocks (not including the first) so as to
3898 // cater for junction station estimates and variances carried forward, reverse and during the combination stage.
3899 // Depending on whether an "in isolation" or "rigorous" adjustment is being performed, the matrix
3900 // dimensions are "grown" or "shrunk" accordingly (without altering the containing data in buffer).
3901
3903
3904 // Is this a staged adjustment for which the matrix data is to be loaded from
3905 // existing stage files created from a previous run?
3906 if (projectSettings_.a.stage && !projectSettings_.a.recreate_stage_files && bms_meta_.reduced)
3907 {
3908 // Staged adjustments only.
3909 // Load matrix data from existing .mtx stage files
3910 // created from a previous run.
3911 PrepareMappedRegions(block);
3912 return;
3913 }
3914
3915 if (!projectSettings_.a.stage)
3916 {
3917 // Back up normals. This copy contains the contributions from all apriori measurement
3918 // variances, excluding parameter station variances and junction station variances
3919 v_normalsR_.at(block) = v_normals_.at(block);
3920
3921 if (projectSettings_.a.multi_thread)
3922 v_normalsRC_.at(block).redim(
3923 v_normalsR_.at(block).rows(), v_normalsR_.at(block).columns());
3924
3925 switch (projectSettings_.a.adjust_mode)
3926 {
3927 case Phased_Block_1Mode:
3928 case PhasedMode:
3930 break;
3931 case SimultaneousMode:
3933 break;
3934 }
3935 }
3936 else
3937 {
3938 // Offload matrices to new .mtx stage files
3939
3940 // Set memory mapped file region offsets for all
3941 // matrices associated with this block
3942 SetRegionOffsets(block);
3943 // Purge from memory all matrices associated with this
3944 // block and write to disk (the memory mapped file)
3945 OffloadBlockToDisk(block);
3946
3947 // A return here is needed to prevent any attempt to
3948 // print v_design_, v_AtVinv_ or v_normals_ in verbose mode
3949 return;
3950 }
3951
3952 if (projectSettings_.a.multi_thread && projectSettings_.g.verbose > 2)
3953 {
3954 adj_file_mutex.lock();
3955 adj_file << thread_id << "> Done." << std::endl;
3956 adj_file_mutex.unlock();
3957 }
3958
3959 if (projectSettings_.g.verbose > 3)
3960 {
3961 debug_file << std::endl;
3962 debug_file << "Design " << std::scientific << std::setprecision(16) << v_design_.at(block) << std::endl;
3963 debug_file << "AtVinv " << std::scientific << std::setprecision(16) << v_AtVinv_.at(block) << std::endl;
3964 debug_file << "Normals " << std::scientific << std::setprecision(16) << v_normals_.at(block) << std::endl;
3965 }
3966}
void PrepareMappedRegions(const UINT32 &block)
void PrepareDesignAndMsrMnsCmpMatrices(const UINT32 &block)
void PrepareStationandVarianceMatrices(const UINT32 &block)
void AddConstraintStationstoNormalsForward(const UINT32 &block)
void OffloadBlockToDisk(const UINT32 &block)
void AddConstraintStationstoNormalsSimultaneous(const UINT32 &block)
void SetRegionOffsets(const UINT32 &block, const int file_count=0,...)
@ SimultaneousMode
@ Phased_Block_1Mode
vUINT32::iterator it_vUINT32
Definition dnatypes.hpp:99

References AddConstraintStationstoNormalsForward(), AddConstraintStationstoNormalsSimultaneous(), adj_file, dynadjust::networkadjust::adj_file_mutex, bms_meta_, bstBinaryRecords_, debug_file, OffloadBlockToDisk(), Phased_Block_1Mode, PhasedMode, PrepareDesignAndMsrMnsCmpMatrices(), PrepareMappedRegions(), PrepareStationandVarianceMatrices(), projectSettings_, SetRegionOffsets(), SimultaneousMode, v_AtVinv_, v_design_, v_ISL_, v_JSL_, v_normals_, v_normalsR_, v_normalsRC_, and v_parameterStationList_.

Referenced by operator=(), and PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareAdjustmentReverse()

bool dynadjust::networkadjust::dna_adjust::PrepareAdjustmentReverse ( const UINT32 block,
bool MT_ReverseOrCombine )

Definition at line 4071 of file dnaadjust.cpp.

4072{
4073 // if this is a single block, then there is no need to perform a reverse adjustment
4074 if (v_blockMeta_.at(currentBlock)._blockIsolated)
4075 {
4076 if (projectSettings_.o._adj_stn_iteration)
4077 {
4078 adj_file_mutex.lock();
4079 adj_file << "Skipping reverse adjustment of (isolated) block " << currentBlock+1 << ". Rigorous coordinates produced in forward pass. " << std::endl << std::endl;
4080 adj_file_mutex.unlock();
4081 }
4082
4083 if (projectSettings_.a.stage)
4084 OffloadBlockToMappedFile(currentBlock);
4085
4086 return false;
4087 }
4088
4089 // If currentBlock is not the last block, then return true so that
4090 // AdjustPhasedReverseCombine can proceed. In this instance, the
4091 // Normals were already formed in CarryReverseEstimates
4092 if (!v_blockMeta_.at(currentBlock)._blockLast)
4093 return true;
4094
4095 // OK. currentBlock is the last block, and this is the commencement of
4096 // a reverse run, so reset coordinates
4097 matrix_2d* estimatedStations(&v_estimatedStations_.at(currentBlock));
4098
4099 if (MT_ReverseOrCombine)
4100 {
4101 estimatedStations = &v_estimatedStationsR_.at(currentBlock);
4102 }
4103 else
4104 {
4105 // Restore back up copy of normals for reverse adjustment in
4106 // single thread mode
4107 v_normals_.at(currentBlock) = v_normalsR_.at(currentBlock);
4108
4109 }
4110
4111 // Reset coordinates to original values
4112 *estimatedStations = v_originalStations_.at(currentBlock);
4113
4114 AddConstraintStationstoNormalsReverse(currentBlock, MT_ReverseOrCombine);
4115
4116 return true;
4117}
void OffloadBlockToMappedFile(const UINT32 &block)

References AddConstraintStationstoNormalsReverse(), adj_file, dynadjust::networkadjust::adj_file_mutex, OffloadBlockToMappedFile(), projectSettings_, v_blockMeta_, v_estimatedStations_, v_estimatedStationsR_, v_normals_, v_normalsR_, and v_originalStations_.

Referenced by AdjustPhasedReverse(), AdjustPhasedReverseCombine(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareAdjustmentCombine()

bool dynadjust::networkadjust::dna_adjust::PrepareAdjustmentCombine ( const UINT32 block,
UINT32 & pseudomsrJSLCount,
bool MT_ReverseOrCombine )

Definition at line 4287 of file dnaadjust.cpp.

4288{
4289 // No combination is required for:
4290 // - first or last blocks of a contiguous network
4291 // - isolated blocks
4292 // - phased adjustment (block 1) only
4293 if (!CombineRequired(currentBlock))
4294 return false;
4295
4296 matrix_2d* estimatedStations(&v_estimatedStations_.at(currentBlock));
4297
4298 if (projectSettings_.a.multi_thread)
4299 estimatedStations = &v_estimatedStationsR_.at(currentBlock);
4300
4301 // Now, update normals taking contribution from the junction station estimates and variances
4302 // of the preceding block estimated in the forward pass
4303 //
4304 // Grow AtVinv and measMinusComp to include JSLs as 'pseudo measurements' from forward adjustment.
4305 //
4306 // For all intermediate blocks, CarryStnEstimatesandVariancesReverse is called immediately after
4307 // an adjustment in the reverse direction, in which measMinusComp is grown to include msr-comp
4308 // values using junction estimates obtained from currentBlock+1. Then CarryStnEstimatesandVariancesCombine
4309 // is called, measMinusComp is grown again to include msr-comp values using junction estimates
4310 // obtained from currentBlock+1. Hence intermediate blocks will be formed as follows:
4311 // _____________
4312 // | |
4313 // | msr-comp |
4314 // |_____________|
4315 // | |
4316 // | jrev-comp | msr-comp values using junction estimates obtained from currentBlock+1 reverse pass
4317 // |_____________|
4318 // | |
4319 // | jfwd-comp | msr-comp values using junction estimates obtained from currentBlock-1 forward pass
4320 // |_____________|
4321 //
4322 // For the last block in a contiguous net, CarryStnEstimatesandVariancesCombine is called but measMinusComp
4323 // is grown only to include msr-comp values using junction estimates obtained from currentBlock+1. Hence,
4324 // the last block will be formed as follows:
4325 // _____________
4326 // | |
4327 // | msr-comp |
4328 // |_____________|
4329 // | |
4330 // | jfwd-comp | msr-comp values using junction estimates obtained from currentBlock-1 forward pass
4331 // |_____________|
4332 //
4333 // The first block does not need a combination adjustment.
4334
4335 // Reset coordinates to originals
4336 *estimatedStations = v_originalStations_.at(currentBlock);
4337
4338 // Carry junction station estimates from currentBlock-1 (obtained during forward
4339 // adjustment) to this block.
4340 CarryStnEstimatesandVariancesCombine(currentBlock-1, currentBlock,
4341 pseudomsrJSLCount, MT_ReverseOrCombine);
4342
4343 AddConstraintStationstoNormalsCombine(currentBlock, MT_ReverseOrCombine);
4344
4345 return true;
4346
4347}
void AddConstraintStationstoNormalsCombine(const UINT32 &block, bool MT_ReverseOrCombine)
void CarryStnEstimatesandVariancesCombine(const UINT32 &nextBlock, const UINT32 &thisBlock, UINT32 &pseudomsrJSLCount, bool MT_ReverseOrCombine)
bool CombineRequired(const UINT32 &block) const

References AddConstraintStationstoNormalsCombine(), CarryStnEstimatesandVariancesCombine(), CombineRequired(), projectSettings_, v_estimatedStations_, v_estimatedStationsR_, and v_originalStations_.

Referenced by AdjustPhasedReverseCombine(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BackupNormals()

void dynadjust::networkadjust::dna_adjust::BackupNormals ( const UINT32 block,
bool MT_ReverseOrCombine )

Definition at line 4121 of file dnaadjust.cpp.

4122{
4123 // This procedure is only required if this block requires a combination
4124 // adjustment to produce rigorous estimates
4125 if (!CombineRequired(block))
4126 return;
4127
4128 matrix_2d* normals(&v_normals_.at(block));
4129 matrix_2d* normalsCopy(&v_normalsR_.at(block));
4130
4131 if (MT_ReverseOrCombine)
4132 {
4133 normals = &v_normalsR_.at(block);
4134 normalsCopy = &v_normalsRC_.at(block);
4135 }
4136
4137 normalsCopy->copyelements(0, 0, normals, 0, 0,
4138 normals->rows(), normals->columns());
4139}

References dynadjust::math::matrix_2d::columns(), CombineRequired(), dynadjust::math::matrix_2d::copyelements(), dynadjust::math::matrix_2d::rows(), v_normals_, v_normalsR_, and v_normalsRC_.

Referenced by AdjustPhasedReverseCombine(), operator=(), and RebuildNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateEstimatesForward()

void dynadjust::networkadjust::dna_adjust::UpdateEstimatesForward ( const UINT32 block)

Definition at line 3984 of file dnaadjust.cpp.

3985{
3986 // update station coordinates with lsq-estimated corrections
3987 v_estimatedStations_.at(currentBlock).add(v_corrections_.at(currentBlock));
3988
3989 // compute degrees of freedom (this is only performed once here during forward pass)
3990 v_statSummary_.at(currentBlock)._degreesofFreedom =
3991 v_measurementParams_.at(currentBlock) +
3992 (v_pseudoMeasCountFwd_.at(currentBlock) * 3) -
3993 v_unknownParams_.at(currentBlock);
3994
3995 if (v_blockMeta_.at(currentBlock)._blockLast || v_blockMeta_.at(currentBlock)._blockIsolated)
3996 {
3997 // update max correction
3998 if (fabs(v_corrections_.at(currentBlock).compute_maximum_value()) > fabs(maxCorr_))
3999 SetmaxCorr(v_corrections_.at(currentBlock).maxvalue());
4000
4001 // update largest correction
4002 if (fabs(v_corrections_.at(currentBlock).maxvalue()) > fabs(largestCorr_))
4003 {
4004 largestCorr_ = v_corrections_.at(currentBlock).maxvalue();
4005 blockLargeCorr_ = currentBlock;
4006 }
4007
4008 // Now copy 'estimated' coordinates to 'rigorous' for comparison on the next iteration
4009 v_rigorousStations_.at(currentBlock) = v_estimatedStations_.at(currentBlock);
4010 v_rigorousVariances_.at(currentBlock) = v_normals_.at(currentBlock);
4011
4012 // Temporarily hold corrections for last block. These corrections will be restored
4013 // in UpdateEstimatesFinal()
4014 if (!projectSettings_.a.multi_thread)
4015 if (v_blockMeta_.at(currentBlock)._blockLast)
4016 v_correctionsR_.at(currentBlock) = v_corrections_.at(currentBlock);
4017 }
4018}

References blockLargeCorr_, largestCorr_, maxCorr_, projectSettings_, SetmaxCorr(), v_blockMeta_, v_corrections_, v_correctionsR_, v_estimatedStations_, v_measurementParams_, v_normals_, v_pseudoMeasCountFwd_, v_rigorousStations_, v_rigorousVariances_, v_statSummary_, and v_unknownParams_.

Referenced by AdjustPhasedForward(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateEstimatesReverse()

void dynadjust::networkadjust::dna_adjust::UpdateEstimatesReverse ( const UINT32 block,
bool MT_ReverseOrCombine )

Definition at line 4621 of file dnaadjust.cpp.

4622{
4623 matrix_2d* estimatedStations(&v_estimatedStations_.at(currentBlock));
4624 matrix_2d* corrections(&v_corrections_.at(currentBlock));
4625 matrix_2d* aposterioriVariances(&v_normals_.at(currentBlock));
4626
4627 if (MT_ReverseOrCombine)
4628 {
4629 estimatedStations = &v_estimatedStationsR_.at(currentBlock);
4630 corrections = &v_correctionsR_.at(currentBlock);
4631 aposterioriVariances = &v_normalsR_.at(currentBlock);
4632 }
4633
4634 // update station coordinates with lsq-estimated corrections
4635 estimatedStations->add(*corrections);
4636
4637 // Print the estimated stations for this block
4638 // At this point, all station estimates are "in isolation". Rigorous to follow...
4639 if (projectSettings_.o._adj_stn_iteration)
4640 {
4641 adj_file_mutex.lock();
4642
4643 if (projectSettings_.a.multi_thread)
4644 {
4645 adj_file << std::endl << "2> Adjusted block " << currentBlock + 1;
4646 if (v_blockMeta_.at(currentBlock)._blockFirst)
4647 adj_file << " (reverse, rigorous) " << std::endl;
4648 else
4649 adj_file << " (reverse, in isolation) " << std::endl;
4650 }
4651
4652 PrintAdjStations(adj_file, currentBlock,
4653 estimatedStations, aposterioriVariances,
4654 false, true, false, true, false);
4655 adj_file_mutex.unlock();
4656 }
4657
4658}

References dynadjust::math::matrix_2d::add(), adj_file, dynadjust::networkadjust::adj_file_mutex, PrintAdjStations(), projectSettings_, v_blockMeta_, v_corrections_, v_correctionsR_, v_estimatedStations_, v_estimatedStationsR_, v_normals_, and v_normalsR_.

Referenced by AdjustPhasedReverse(), AdjustPhasedReverseCombine(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateEstimatesCombine()

void dynadjust::networkadjust::dna_adjust::UpdateEstimatesCombine ( const UINT32 block,
UINT32 prevJSLCount )

Definition at line 4661 of file dnaadjust.cpp.

4662{
4663 matrix_2d* estimatedStations(&v_estimatedStations_.at(currentBlock));
4664 matrix_2d* corrections(&v_corrections_.at(currentBlock));
4665 matrix_2d* AtVinv(&v_AtVinv_.at(currentBlock));
4666 matrix_2d* measMinusComp(&v_measMinusComp_.at(currentBlock));
4667
4668 if (projectSettings_.a.multi_thread)
4669 {
4670 estimatedStations = &v_estimatedStationsR_.at(currentBlock);
4671 corrections = &v_correctionsR_.at(currentBlock);
4672 AtVinv = &v_AtVinvR_.at(currentBlock);
4673 measMinusComp = &v_measMinusCompR_.at(currentBlock);
4674 }
4675
4676 // copy estimated parameter station coordinates
4677 estimatedStations->add(*corrections);
4678
4679 // Now, combination adjustment is complete, so shrink to "exclude" JSLs from
4680 // the next reverse adjustment.
4681 AtVinv->shrink(0, pseudomsrJSLCount);
4682 measMinusComp->shrink(pseudomsrJSLCount, 0);
4683}

References dynadjust::math::matrix_2d::add(), projectSettings_, dynadjust::math::matrix_2d::shrink(), v_AtVinv_, v_AtVinvR_, v_corrections_, v_correctionsR_, v_estimatedStations_, v_estimatedStationsR_, v_measMinusComp_, and v_measMinusCompR_.

Referenced by AdjustPhasedReverseCombine(), and operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateEstimatesFinal()

void dynadjust::networkadjust::dna_adjust::UpdateEstimatesFinal ( const UINT32 currentBlock)

Definition at line 4687 of file dnaadjust.cpp.

4688{
4689 // Is this the last block? If so, the rigorous estimates were updated during the
4690 // forward pass - copy values from v_correctionsR_.
4691 if (v_blockMeta_.at(currentBlock)._blockLast)
4692 {
4693 if (projectSettings_.a.multi_thread)
4694 return;
4695 if (projectSettings_.a.adjust_mode == Phased_Block_1Mode)
4696 return;
4697 v_corrections_.at(currentBlock) = v_correctionsR_.at(currentBlock);
4698 return;
4699 }
4700
4701 matrix_2d* estimatedStations(&v_estimatedStations_.at(currentBlock));
4702 matrix_2d* corrections(&v_corrections_.at(currentBlock));
4703 matrix_2d* AtVinv(&v_AtVinv_.at(currentBlock));
4704 matrix_2d* measMinusComp(&v_measMinusComp_.at(currentBlock));
4705 matrix_2d* aposterioriVariances(&v_normals_.at(currentBlock));
4706
4707 if (projectSettings_.a.multi_thread)
4708 {
4709 estimatedStations = &v_estimatedStationsR_.at(currentBlock);
4710 corrections = &v_correctionsR_.at(currentBlock);
4711 AtVinv = &v_AtVinvR_.at(currentBlock);
4712 measMinusComp = &v_measMinusCompR_.at(currentBlock);
4713 aposterioriVariances = &v_normalsR_.at(currentBlock);
4714 }
4715
4716 if (v_blockMeta_.at(currentBlock)._blockFirst)
4717 {
4718 // If this point is reached, rigorous adjustment is complete for a contiguous network, so
4719 // shrink to "exclude" JSLs from the next iteration.
4720 AtVinv->shrink(0, static_cast<UINT32>(v_JSL_.at(currentBlock).size() * 3));
4721 measMinusComp->shrink(static_cast<UINT32>(v_JSL_.at(currentBlock).size() * 3), 0);
4722 }
4723
4724 // update max correction
4725 if (fabs(corrections->compute_maximum_value()) > fabs(maxCorr_))
4726 SetmaxCorr(corrections->maxvalue());
4727
4728 // update largest correction
4729 if (fabs(corrections->maxvalue()) > fabs(largestCorr_))
4730 {
4731 largestCorr_ = corrections->maxvalue();
4732 blockLargeCorr_ = currentBlock;
4733 }
4734
4735 if (projectSettings_.a.multi_thread)
4736 {
4737 v_corrections_.at(currentBlock) = v_correctionsR_.at(currentBlock);
4738 v_estimatedStations_.at(currentBlock) = v_estimatedStationsR_.at(currentBlock);
4739 v_normals_.at(currentBlock) = v_normalsR_.at(currentBlock);
4740 }
4741
4742 // Now copy 'estimated' coordinates to 'rigorous' for comparison on the next iteration
4743 v_rigorousStations_.at(currentBlock) = *estimatedStations;
4744 v_rigorousVariances_.at(currentBlock) = *aposterioriVariances;
4745
4746 // update original coordinates
4747 v_originalStations_.at(currentBlock) = v_rigorousStations_.at(currentBlock);
4748
4749 // If this is the first block, return since UpdateEstimateReverse prints station
4750 // coordinates
4751 if (v_blockMeta_.at(currentBlock)._blockFirst)
4752 return;
4753
4754 // print the 'rigorous' stations for this block
4755 if (projectSettings_.o._adj_stn_iteration)
4756 {
4757
4758 adj_file_mutex.lock();
4759 if (projectSettings_.a.multi_thread)
4760 adj_file << std::endl << "3> Adjusted block " << currentBlock + 1 << " (rigorous)" << std::endl;
4761
4762 PrintAdjStations(adj_file, currentBlock,
4763 &v_rigorousStations_.at(currentBlock), &v_rigorousVariances_.at(currentBlock),
4764 false, true, false, true, false); // update coordinates
4765
4766 adj_file_mutex.unlock();
4767 }
4768}

References adj_file, dynadjust::networkadjust::adj_file_mutex, blockLargeCorr_, dynadjust::math::matrix_2d::compute_maximum_value(), largestCorr_, maxCorr_, dynadjust::math::matrix_2d::maxvalue(), Phased_Block_1Mode, PrintAdjStations(), projectSettings_, SetmaxCorr(), dynadjust::math::matrix_2d::shrink(), v_AtVinv_, v_AtVinvR_, v_blockMeta_, v_corrections_, v_correctionsR_, v_estimatedStations_, v_estimatedStationsR_, v_JSL_, v_measMinusComp_, v_measMinusCompR_, v_normals_, v_normalsR_, v_originalStations_, v_rigorousStations_, and v_rigorousVariances_.

Referenced by AdjustPhasedReverse(), AdjustPhasedReverseCombine(), operator=(), and UpdateEstimatesFinalNoCombine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateEstimatesFinalNoCombine()

void dynadjust::networkadjust::dna_adjust::UpdateEstimatesFinalNoCombine ( )

Definition at line 267 of file dnaadjust-multi.cpp.

268{
269 for (UINT32 block(0); block<blockCount_; ++block)
271}
void UpdateEstimatesFinal(const UINT32 currentBlock)

References blockCount_, and UpdateEstimatesFinal().

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GenerateStatistics()

void dynadjust::networkadjust::dna_adjust::GenerateStatistics ( )

Definition at line 7797 of file dnaadjust.cpp.

7798{
7799 // Backup the latest estimates and, if this is not a staged
7800 // adjustment, update normals and measured-computed matrices.
7801 UpdateAdjustment(false);
7802
7803 // Compute whole-of-network statistics.
7805
7806 // Print statistics summary to adj file
7807 switch (projectSettings_.a.adjust_mode)
7808 {
7809 case Phased_Block_1Mode:
7810 PrintStatistics(false);
7811 break;
7812 //case SimultaneousMode:
7813 //case PhasedMode:
7814 default:
7816 break;
7817 }
7818
7820 // non zero means something is amiss
7821 adjustStatus_ ||
7822 // a much larger than expected outcome
7824 // didn't converge
7825 fabs(maxCorr_) > projectSettings_.a.iteration_threshold);
7826}
void PrintStatistics(bool printPelzer=true)

References adjustStatus_, chiSquaredUpperLimit_, ComputeStatistics(), isAdjustmentQuestionable_, maxCorr_, Phased_Block_1Mode, PrintStatistics(), projectSettings_, sigmaZero_, and UpdateAdjustment().

Referenced by GenerateStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareAdjustment()

void dynadjust::networkadjust::dna_adjust::PrepareAdjustment ( const project_settings & adjustmentSettings)

Definition at line 250 of file dnaadjust.cpp.

251{
252 isPreparing_ = true;
253 isAdjusting_ = true;
254 isCombining_ = false;
256 projectSettings_ = projectSettings;
257
258 if (projectSettings_.a.stage &&
259 (projectSettings_.a.adjust_mode == SimultaneousMode ||
260 projectSettings_.a.multi_thread))
261 projectSettings_.a.stage = false;
262
263 // Load the bst/bms meta and set the default
264 // reference frame (via binary station file)
266
267 // Open output files for printing adjustment results
270
271 // Initialise adjustment consts
273
274 // Load network files
276
277 // Load type b uncertainties, method handler, and the station map
279
281
282 // Resizes matrix vectors using blockCount_.
283 // For phased adjustments, segmentation file is loaded
285
286 if (!projectSettings_.a.report_mode)
287 {
288 std::string block_str(" block");
289 if (blockCount_ > 1)
290 block_str.append("s");
291 block_str.append(")... ");
292
293 adj_file << std::endl << "+ Preparing for adjustment";
294 switch (projectSettings_.a.adjust_mode)
295 {
297 case PhasedMode:
298 adj_file << std::left << " (" << blockCount_<< block_str;
299 if (projectSettings_.a.multi_thread && projectSettings_.g.verbose > 2)
300 adj_file << std::endl;
301 break;
302 case SimultaneousMode:
303 adj_file << std::left << "... ";
304 }
305 adj_file.flush();
306 }
307
308 try {
309
310 // PrepareAdjustmentMultiThread works well but fails if there
311 // is insufficient memory. Needs a little more work to catch
312 // out of memory exception.
313
314#ifndef _MSDEBUG
315 // Only call PrepareAdjustmentMultiThread if:
316 // - not in staged adjustment mode, and
317 // - not running debugger
318 if (!projectSettings_.a.stage)
320 else
321#endif // #ifndef _MSDEBUG
322 {
323 // Prepare initial matrices for least squares adjustment
324 for (UINT32 block(0); block<blockCount_; ++block)
325 {
326 // update block no. for progress count
327 SetcurrentBlock(block);
328
330
331 // Prepare adjustment for this block
333 }
334 }
335 }
336 catch (const NetMemoryException& e) {
337 std::stringstream ss;
338 double memory;
339 try { GetMemoryFootprint(memory, GIGABYTE_SIZE); }
340 catch (...) { /*do nothing*/ }
341
342 ss << "PrepareAdjustment(): Process terminated while allocating memory for the " << std::endl << " adjustment matrices. " <<
343 "Details: " << std::endl << " " << e.what() << std::endl;
344 ss << " The memory footprint consumed by " << __BINARY_NAME__ << " is " <<
345 std::fixed << std::setprecision(2) << memory << " GB" << std::endl;
346 adj_file << "- Error" << std::endl << " " << ss.str();
348 }
349 catch (const std::runtime_error& e) {
350 std::stringstream ss;
351 ss << "PrepareAdjustment(): Process terminated while preparing the " << std::endl << " adjustment matrices. " <<
352 "Details: " << std::endl << " " << e.what() << std::endl;
353 adj_file << "- Error" << std::endl << " " << ss.str();
355 }
356 catch (...) {
357 std::stringstream ss;
358 ss << "PrepareAdjustment(): Process terminated while preparing the " << std::endl << " adjustment matrices. " << std::endl;
359 adj_file << "- Error" << std::endl << " " << ss.str();
360 SignalExceptionAdjustment(ss.str(), 0);
361 }
362
363 bms_meta_.reduced = true;
364
365 if (projectSettings_.a.stage)
366 {
367 // Close binary file streams
368 if (projectSettings_.a.recreate_stage_files)
370
371 // Set memory mapped file regions
372 // NOTE - previously created files must exist and match the
373 // dimensions of the current matrix sizes
374 try {
376 }
377 catch (boost::interprocess::interprocess_exception& e){
378 std::stringstream ss;
379 ss << "PrepareMappedRegions() terminated while creating memory map" << std::endl;
380 ss << " regions from .mtx stage files. Details:\n " << e.what() << std::endl << std::endl;
381 ss << " Please ensure the .mtx stage files from a previous staged" << std::endl;
382 ss << " adjustment exist, or re-run the adjustment using the" << std::endl;
383 ss << " --" << RECREATE_STAGE_FILES << " option." << std::endl;
384 adj_file << std::endl << "- Error: " << ss.str() << std::endl;
385 SignalExceptionAdjustment(ss.str(), 0);
386 }
387 }
388
390
391 isPreparing_ = false;
392
393 if (projectSettings_.a.multi_thread)
394 {
395 try {
401 }
402 catch (...)
403 {
404 std::stringstream ss;
405 ss << "Failed to assign matrices for multi-thread adjustment." << std::endl;
406 SignalExceptionAdjustment(ss.str(), 0);
407 }
408 }
409
410 if (projectSettings_.a.adjust_mode == SimultaneousMode)
412
414
415 if (projectSettings_.o._adj_msr_final ||
416 projectSettings_.o._adj_msr_iteration)
417 // Create a vector of pairs (cml_id , block)
418 // FormUniqueMsrList returns msr_block sorted according to block
420
421 if (projectSettings_.g.verbose > 3)
422 debug_file << std::endl << std::endl;
423
424 if (!projectSettings_.a.report_mode)
425 {
426 if (projectSettings_.a.multi_thread && projectSettings_.g.verbose > 2)
427 adj_file << "+ Preparing for adjustment is";
428
429 adj_file << " done.";
430
431 if (projectSettings_.g.verbose > 0)
432 {
433 double memory;
434 std::stringstream ss;
435 try {
437 ss << std::endl << "+ The memory footprint consumed by " << __BINARY_NAME__ << " is " <<
438 std::fixed << std::setprecision(2) << memory << " GB" << std::endl;
439 adj_file << ss.str();
440 }
441 catch (...) { /*do nothing*/ }
442 }
443 }
444}
virtual const char * what() const
void CreateMeasurementTally(const UINT32 &block=0)
void SignalExceptionAdjustment(const std::string &msg, const UINT32 block_no)
void SetMapRegions(const int file_count=0,...)
void SetcurrentBlock(const UINT32 b)
void GetMemoryFootprint(double &memory, const _MEM_UNIT_ unit)
void PrepareAdjustmentBlock(const UINT32 block, const UINT32 thread_id=0)
@ GIGABYTE_SIZE
const char *const RECREATE_STAGE_FILES

References adj_file, blockCount_, bms_meta_, BuildSimultaneousStnAppearance(), BuildUniqueBlockStationMap(), CloseStageFileStreams(), CreateMeasurementTally(), currentBlock_, debug_file, degreesofFreedom_, FormUniqueMsrList(), GetMemoryFootprint(), GIGABYTE_SIZE, InitialiseAdjustment(), InitialiseTypeBUncertainties(), isAdjusting_, isCombining_, isFirstTimeAdjustment_, isPreparing_, LoadNetworkFiles(), measurementParams_, OpenOutputFileStreams(), Phased_Block_1Mode, PhasedMode, PrepareAdjustmentBlock(), PrepareAdjustmentMultiThread(), PrintOutputFileHeaderInfo(), projectSettings_, RECREATE_STAGE_FILES, ResizeMatrixVectors(), SetcurrentBlock(), SetDefaultReferenceFrame(), SetMapRegions(), SignalExceptionAdjustment(), SimultaneousMode, unknownParams_, v_AtVinv_, v_AtVinvR_, v_design_, v_designR_, v_estimatedStations_, v_estimatedStationsR_, v_junctionVariances_, v_junctionVariancesR_, v_measMinusComp_, v_measMinusCompR_, and dynadjust::exception::NetMemoryException::what().

Referenced by operator=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CancelAdjustment()

void dynadjust::networkadjust::dna_adjust::CancelAdjustment ( )
inline

Definition at line 258 of file dnaadjust.hpp.

258{ isCancelled_.store(true); }

References isCancelled_.

◆ IsCancelled()

bool dynadjust::networkadjust::dna_adjust::IsCancelled ( ) const
inline

Definition at line 259 of file dnaadjust.hpp.

259{ return isCancelled_.load(); };

References isCancelled_.

Referenced by AdjustPhased(), AdjustPhasedForward(), AdjustPhasedMultiThread(), AdjustPhasedReverse(), AdjustPhasedReverseCombine(), AdjustSimultaneous(), UpdateAdjustment(), and ValidateandFinaliseAdjustment().

Here is the caller graph for this function:

◆ GetStatus()

_ADJUST_STATUS_ dynadjust::networkadjust::dna_adjust::GetStatus ( ) const
inline

Definition at line 261 of file dnaadjust.hpp.

261{ return adjustStatus_; }

References adjustStatus_.

Referenced by main(), and PrintSummaryMessage().

Here is the caller graph for this function:

◆ IsPreparing()

bool dynadjust::networkadjust::dna_adjust::IsPreparing ( )
inline

Definition at line 262 of file dnaadjust.hpp.

262{ return isPreparing_; }

References isPreparing_.

◆ IsAdjusting()

bool dynadjust::networkadjust::dna_adjust::IsAdjusting ( )
inline

Definition at line 263 of file dnaadjust.hpp.

263{ return isAdjusting_; }

References isAdjusting_.

◆ ExceptionRaised()

bool dynadjust::networkadjust::dna_adjust::ExceptionRaised ( )
inline

Definition at line 264 of file dnaadjust.hpp.

264 {
266 }

References ADJUST_EXCEPTION_RAISED, and adjustStatus_.

◆ PrintAdjustedNetworkStations()

void dynadjust::networkadjust::dna_adjust::PrintAdjustedNetworkStations ( )

Definition at line 2372 of file dnaadjust.cpp.

2373{
2374 // print adjusted coordinates
2375 bool printHeader(true);
2376
2377 switch (projectSettings_.a.adjust_mode)
2378 {
2379 case SimultaneousMode:
2380 PrintAdjStations(adj_file, 0, &v_estimatedStations_.at(0), &v_rigorousVariances_.at(0), false, true, true, printHeader, true);
2381 PrintAdjStations(xyz_file, 0, &v_estimatedStations_.at(0), &v_rigorousVariances_.at(0), false, false, false, printHeader, false);
2382 break;
2383 case PhasedMode:
2384 case Phased_Block_1Mode:
2385 // Output phased blocks as a single block?
2386 if (!projectSettings_.o._output_stn_blocks)
2387 {
2391 true, true, true);
2395 true, true, false);
2396 return;
2397 }
2398
2399 for (UINT32 block=0; block<blockCount_; ++block)
2400 {
2401 // Are phased blocks to be written to disk instead of
2402 // being held in memory?
2403 if (projectSettings_.a.stage)
2404 {
2407
2408 if (projectSettings_.o._init_stn_corrections || projectSettings_.o._stn_corr)
2411 }
2412
2413 // adj file
2415 &v_rigorousStations_.at(block),
2416 &v_rigorousVariances_.at(block),
2417 true, true, true, printHeader, true);
2418 // xyz file
2420 &v_rigorousStations_.at(block),
2421 &v_rigorousVariances_.at(block),
2422 true, false, false, printHeader, false);
2423
2424 printHeader = false;
2425
2426 // Release block from memory
2427 if (projectSettings_.a.stage)
2428 {
2430
2431 // Were original station estimates updated? If so, serialise, otherwise unload
2432 if (projectSettings_.o._init_stn_corrections || projectSettings_.o._stn_corr)
2435 }
2436
2437 // Exit if block-1 mode
2438 if (projectSettings_.a.adjust_mode == Phased_Block_1Mode)
2439 break;
2440 }
2441 break;
2442 }
2443}
void SerialiseBlockToMappedFile(const UINT32 &block, const int file_count=0,...)
void UnloadBlock(const UINT32 &block, const int file_count=0,...)
void PrintAdjStationsUniqueList(std::ostream &os, const v_mat_2d *stationEstimates, v_mat_2d *stationVariances, bool recomputeGeographicCoords, bool updateGeographicCoords, bool reapplyTypeBUncertainties)
@ sf_rigorous_vars
Definition dnatypes.hpp:461
@ sf_rigorous_stns
Definition dnatypes.hpp:456
@ sf_original_stns
Definition dnatypes.hpp:455

References adj_file, blockCount_, DeserialiseBlockFromMappedFile(), Phased_Block_1Mode, PhasedMode, PrintAdjStations(), PrintAdjStationsUniqueList(), projectSettings_, SerialiseBlockToMappedFile(), sf_original_stns, sf_rigorous_stns, sf_rigorous_vars, SimultaneousMode, UnloadBlock(), v_estimatedStations_, v_rigorousStations_, v_rigorousVariances_, and xyz_file.

Referenced by PrintAdjustedNetworkStations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintPositionalUncertainty()

void dynadjust::networkadjust::dna_adjust::PrintPositionalUncertainty ( )

Definition at line 2516 of file dnaadjust.cpp.

2517{
2518 std::ofstream apu_file;
2519 try {
2520 // Create apu file. Throws runtime_error on failure.
2521 file_opener(apu_file, projectSettings_.o._apu_file);
2522 }
2523 catch (const std::runtime_error& e) {
2524 SignalExceptionAdjustment(e.what(), 0);
2525 }
2526
2527 // Print formatted header
2528 print_file_header(apu_file, "DYNADJUST POSITIONAL UNCERTAINTY OUTPUT FILE");
2529
2530 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "File name:" << boost::filesystem::system_complete(projectSettings_.o._apu_file).string() << std::endl << std::endl;
2531
2532 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "PU confidence interval:" << std::setprecision(1) << std::fixed <<
2533 // projectSettings_.a.confidence_interval << "%" << std::endl;
2534 // the SP1 standard for PU is 95% and the formula is designed to achieve that end,
2535 // irrespective of the adjustment confidence interval
2536 95.0 << "%" << std::endl;
2537
2538 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "Error ellipse axes:" << std::setprecision(1) << std::fixed <<
2539 68.3 << "% (1 sigma)" << std::endl;
2540
2541 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "Variances:" << std::setprecision(1) << std::fixed <<
2542 68.3 << "% (1 sigma)" << std::endl;
2543
2544 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "Stations printed in blocks:";
2545 if (projectSettings_.a.adjust_mode != SimultaneousMode)
2546 {
2547 if (projectSettings_.o._output_stn_blocks)
2548 apu_file << "Yes" << std::endl;
2549 else
2550 {
2551 if (projectSettings_.o._output_pu_covariances)
2552 apu_file << std::left << "Yes (enforced with output-all-covariances)" << std::endl;
2553 else
2554 apu_file << std::left << "No" << std::endl;
2555 }
2556 }
2557 else
2558 apu_file << std::left << "No" << std::endl;
2559
2560 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "Variance matrix units:";
2561 switch (projectSettings_.o._apu_vcv_units)
2562 {
2563 case ENU_apu_ui:
2564 apu_file << std::left << "ENU" << std::endl;
2565 break;
2566 default:
2567 case XYZ_apu_ui:
2568 apu_file << std::left << "XYZ" << std::endl;
2569 break;
2570 }
2571
2572 apu_file <<
2573 std::setw(PRINT_VAR_PAD) << std::left << "Full covariance matrix:";
2574 if (projectSettings_.o._output_pu_covariances)
2575 apu_file << std::left << "Yes" << std::endl;
2576 else
2577 apu_file << std::left << "No" << std::endl;
2578
2579 if (projectSettings_.o._apply_type_b_file || projectSettings_.o._apply_type_b_global)
2580 {
2581 if (projectSettings_.o._apply_type_b_global)
2582 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "Type B uncertainties:" <<
2583 projectSettings_.a.type_b_global << std::endl;
2584
2585 if (projectSettings_.o._apply_type_b_file)
2586 apu_file << std::setw(PRINT_VAR_PAD) << std::left << "Type B uncertainty file:" <<
2587 boost::filesystem::system_complete(projectSettings_.a.type_b_file).string() << std::endl;
2588 }
2589
2590 apu_file << OUTPUTLINE << std::endl << std::endl;
2591
2592 apu_file << "Positional uncertainty of adjusted station coordinates" << std::endl;
2593 apu_file << "------------------------------------------------------" << std::endl;
2594
2595 apu_file << std::endl;
2596
2597 switch (projectSettings_.a.adjust_mode)
2598 {
2599 case SimultaneousMode:
2600 PrintPosUncertainties(apu_file, 0,
2601 &v_rigorousVariances_.at(0));
2602 break;
2603 case PhasedMode:
2604 // Output phased blocks as a single block?
2605 if (!projectSettings_.o._output_stn_blocks && // Print stations in blocks?
2606 !projectSettings_.o._output_pu_covariances) // Print covariances?
2607 // If covariances are required, stations
2608 // must be printed in blocks.
2609 {
2612 return;
2613 }
2614
2615 for (UINT32 block=0; block<blockCount_; ++block)
2616 {
2617 // load up this block
2618 if (projectSettings_.a.stage)
2621
2622 PrintPosUncertainties(apu_file, block,
2623 &v_rigorousVariances_.at(block));
2624
2625 // unload this block
2626 if (projectSettings_.a.stage)
2627 UnloadBlock(block, 1,
2629 }
2630 break;
2631 case Phased_Block_1Mode: // only the first block is rigorous
2632 PrintPosUncertainties(apu_file, 0,
2633 &v_rigorousVariances_.at(0));
2634 break;
2635 }
2636
2637 apu_file.close();
2638}
void PrintPosUncertainties(std::ostream &os, const UINT32 &block, const matrix_2d *stationVariances)
void PrintPosUncertaintiesUniqueList(std::ostream &os, const v_mat_2d *stationVariances)
const char *const OUTPUTLINE
const UINT32 PRINT_VAR_PAD(35)
void file_opener(T *stream, const std::string &str, std::ios_base::openmode mode=std::ios_base::out, const iosMode type=ascii, bool fileMustExist=false)
void print_file_header(T &stream, const std::string &header)
@ XYZ_apu_ui
@ ENU_apu_ui

References blockCount_, DeserialiseBlockFromMappedFile(), ENU_apu_ui, file_opener(), OUTPUTLINE, Phased_Block_1Mode, PhasedMode, print_file_header(), PRINT_VAR_PAD(), PrintPosUncertainties(), PrintPosUncertaintiesUniqueList(), projectSettings_, sf_rigorous_vars, SignalExceptionAdjustment(), SimultaneousMode, UnloadBlock(), v_rigorousVariances_, and XYZ_apu_ui.

Referenced by PrintPositionalUncertainty().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintNetworkStationCorrections()

void dynadjust::networkadjust::dna_adjust::PrintNetworkStationCorrections ( )

Definition at line 2642 of file dnaadjust.cpp.

2643{
2644 std::ofstream cor_file;
2645 try {
2646 // Create cor file. Throws runtime_error on failure.
2647 file_opener(cor_file, projectSettings_.o._cor_file);
2648 }
2649 catch (const std::runtime_error& e) {
2650 SignalExceptionAdjustment(e.what(), 0);
2651 }
2652
2653 // Print formatted header
2654 print_file_header(cor_file, "DYNADJUST CORRECTIONS OUTPUT FILE");
2655 cor_file << std::setw(PRINT_VAR_PAD) << std::left << "File name:" << boost::filesystem::system_complete(projectSettings_.o._cor_file).string() << std::endl << std::endl;
2656
2657 cor_file << std::setw(PRINT_VAR_PAD) << std::left << "Stations printed in blocks:";
2658 if (projectSettings_.a.adjust_mode != SimultaneousMode &&
2659 projectSettings_.o._output_stn_blocks)
2660 cor_file << "Yes" << std::endl << std::endl;
2661 else
2662 cor_file << "No" << std::endl;
2663 cor_file << OUTPUTLINE << std::endl << std::endl;
2664
2665 cor_file << "Corrections to stations" << std::endl;
2666 cor_file << "------------------------------------------" << std::endl << std::endl;
2667
2668 switch (projectSettings_.a.adjust_mode)
2669 {
2670 case SimultaneousMode:
2671 PrintCorStations(cor_file, 0);
2672 break;
2673 case PhasedMode:
2674 // Output phased blocks as a single block?
2675 if (!projectSettings_.o._output_stn_blocks)
2676 {
2678 return;
2679 }
2680
2681 for (UINT32 block=0; block<blockCount_; ++block)
2682 {
2683 // load up this block
2684 if (projectSettings_.a.stage)
2687
2688 PrintCorStations(cor_file, block);
2689
2690 // unload previous block
2691 if (projectSettings_.a.stage)
2692 UnloadBlock(block, 2,
2694 }
2695 break;
2696 case Phased_Block_1Mode: // only the first block is rigorous
2697 PrintCorStations(cor_file, 0);
2698 break;
2699 }
2700
2701 cor_file.close();
2702}
void PrintCorStations(std::ostream &cor_file, const UINT32 &block)
void PrintCorStationsUniqueList(std::ostream &cor_file)

References blockCount_, DeserialiseBlockFromMappedFile(), file_opener(), OUTPUTLINE, Phased_Block_1Mode, PhasedMode, print_file_header(), PRINT_VAR_PAD(), PrintCorStations(), PrintCorStationsUniqueList(), projectSettings_, sf_original_stns, sf_rigorous_stns, SignalExceptionAdjustment(), SimultaneousMode, and UnloadBlock().

Referenced by PrintStationCorrections().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjustedNetworkMeasurements()

void dynadjust::networkadjust::dna_adjust::PrintAdjustedNetworkMeasurements ( )

Definition at line 3202 of file dnaadjust.cpp.

3203{
3205 return;
3206
3207 bool printHeader(true);
3208
3209 if (projectSettings_.o._database_ids)
3210 if (!databaseIDsLoaded_ || v_msr_db_map_.empty())
3212
3213 _it_uint32_u32u32_pair begin, end;
3214
3215 switch (projectSettings_.a.adjust_mode)
3216 {
3217 case Phased_Block_1Mode: // only the first block is rigorous
3218 begin = v_msr_block_.begin();
3219 end = begin + v_CML_.at(0).size();
3220 PrintAdjMeasurements(v_uint32_u32u32_pair(begin, end), printHeader);
3221 break;
3222 case SimultaneousMode:
3223 PrintAdjMeasurements(v_msr_block_, printHeader);
3224 break;
3225 case PhasedMode:
3226 if (projectSettings_.o._output_msr_blocks)
3227 {
3228 begin = v_msr_block_.begin();
3229
3230 for (UINT32 block=0; block<blockCount_; ++block)
3231 {
3232 // send subvector of measurements from this block
3233 end = begin + v_CML_.at(block).size();
3234
3235 PrintAdjMeasurements(v_uint32_u32u32_pair(begin, end), printHeader);
3236 begin = end;
3237 printHeader = false;
3238 }
3239 }
3240 else
3241 {
3242 PrintAdjMeasurements(v_msr_block_, printHeader);
3243 }
3244 }
3245
3246 switch (projectSettings_.a.adjust_mode)
3247 {
3248 case PhasedMode:
3249 case SimultaneousMode:
3250 if (projectSettings_.o._print_ignored_msrs)
3251 // Print comparison between ignored and computed
3252 // measurements from adjusted coordinates
3254 break;
3255 }
3256}
v_msr_database_id_map v_msr_db_map_
void PrintAdjMeasurements(v_uint32_u32u32_pair msr_block, bool printHeader)
void PrintIgnoredAdjMeasurements(bool printHeader)
@ ADJUST_TEST_FAILED
v_uint32_u32u32_pair::iterator _it_uint32_u32u32_pair
Definition dnatypes.hpp:293
std::vector< uint32_u32u32_pair > v_uint32_u32u32_pair
Definition dnatypes.hpp:287

References ADJUST_TEST_FAILED, adjustStatus_, blockCount_, databaseIDsLoaded_, LoadDatabaseId(), Phased_Block_1Mode, PhasedMode, PrintAdjMeasurements(), PrintIgnoredAdjMeasurements(), projectSettings_, SimultaneousMode, v_CML_, v_msr_block_, and v_msr_db_map_.

Referenced by PrintAdjustedMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintMeasurementsToStation()

void dynadjust::networkadjust::dna_adjust::PrintMeasurementsToStation ( )

Definition at line 3297 of file dnaadjust.cpp.

3298{
3299 // Create Measurement tally. Loads up the AML file.
3301
3302 // Print measurement to station summary header
3303 std::string header("Measurements to Station ");
3305
3306 _it_vmsrtally it_vstnmsrs;
3307
3308 vUINT32 vStationList(bstBinaryRecords_.size());
3309 it_vUINT32 _it_stn(vStationList.begin());
3310
3311 // initialise vector with 0,1,2,...,n-2,n-1,n
3312 initialiseIncrementingIntegerVector<UINT32>(vStationList, static_cast<UINT32>(bstBinaryRecords_.size()));
3313
3314 // Print measurement to station summary, sort stations as required
3315 switch (projectSettings_.o._sort_msr_to_stn)
3316 {
3317 case meas_stn_sort_ui:
3318 {
3319 // sort summary according to measurement to station count
3320 CompareMeasCount<CAStationList, UINT32> msrcountCompareFunc(&vAssocStnList_);
3321 std::sort(vStationList.begin(), vStationList.end(), msrcountCompareFunc);
3322 }
3323 break;
3324 case orig_stn_sort_ui:
3325 default:
3326 {
3327 // sort summary according to original station file order
3328 CompareStnFileOrder<station_t, UINT32> stnorderCompareFunc(&bstBinaryRecords_);
3329 std::sort(vStationList.begin(), vStationList.end(), stnorderCompareFunc);
3330 }
3331 break;
3332 }
3333
3334 // Print measurements to each station and the total count for each station
3335 for (_it_stn=vStationList.begin(); _it_stn != vStationList.end(); ++_it_stn)
3336 v_stnmsrTally_.at(*_it_stn).coutSummaryMsrToStn(adj_file, bstBinaryRecords_.at(*_it_stn).stationName);
3337
3338 // Print "the bottom line"
3340
3341 // Print the total count per measurement
3342 MsrTally msrTally;
3343 for (it_vstnmsrs=v_stnmsrTally_.begin(); it_vstnmsrs!=v_stnmsrTally_.end(); ++it_vstnmsrs)
3344 msrTally += *it_vstnmsrs;
3345
3346 msrTally.coutSummaryMsrToStn(adj_file, "Totals");
3347
3348 adj_file << std::endl << std::endl;
3349}
void coutSummaryMsrToStn(std::ostream &os, const std::string &station)
void initialiseIncrementingIntegerVector(std::vector< T > &vt, const T &size)
@ orig_stn_sort_ui
@ meas_stn_sort_ui
std::vector< UINT32 > vUINT32
Definition dnatypes.hpp:96
vmsrtally::iterator _it_vmsrtally
void MsrToStnSummaryHeaderLine(T &stream)
void MsrToStnSummaryHeader(T &stream, std::string &header)

References adj_file, bstBinaryRecords_, dynadjust::measurements::MsrTally::coutSummaryMsrToStn(), CreateMsrToStnTally(), initialiseIncrementingIntegerVector(), meas_stn_sort_ui, dynadjust::measurements::MsrToStnSummaryHeader(), dynadjust::measurements::MsrToStnSummaryHeaderLine(), orig_stn_sort_ui, projectSettings_, v_stnmsrTally_, and vAssocStnList_.

Referenced by PrintMeasurementstoStations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintEstimatedStationCoordinatestoSNX()

bool dynadjust::networkadjust::dna_adjust::PrintEstimatedStationCoordinatestoSNX ( std::string & sinex_file)

Definition at line 2704 of file dnaadjust.cpp.

2705{
2706 std::ofstream sinex_file;
2707 std::string sinexFilename;
2708 std::string sinexBasename = projectSettings_.g.output_folder + FOLDER_SLASH + projectSettings_.g.network_name;
2709 std::stringstream ssBlock;
2710
2711 matrix_2d *estimates = nullptr, *variances = nullptr;
2712
2713 bool success(true);
2714
2715 // Print a sinex file for each block
2716 for (UINT32 block(0); block<blockCount_; ++block)
2717 {
2718 sinexFilename = sinexBasename;
2719
2720 // Add block number for phased adjustments
2721 switch (projectSettings_.a.adjust_mode)
2722 {
2723 case Phased_Block_1Mode:
2724 if (block > 0)
2725 {
2726 block = blockCount_;
2727 continue;
2728 }
2729 [[fallthrough]];
2730 case PhasedMode:
2731 ssBlock.str("");
2732 ssBlock << "-block" << block + 1;
2733 sinexFilename += ssBlock.str();
2734
2735 // if staged, load up the block from memory mapped files
2736 if (projectSettings_.a.stage)
2739
2740 estimates = &v_rigorousStations_.at(block);
2741 variances = &v_rigorousVariances_.at(block);
2742 break;
2743 case SimultaneousMode:
2744 estimates = &v_estimatedStations_.at(block);
2745 variances = &v_normals_.at(block);
2746 }
2747
2748 // add reference frame to file name
2749 sinexFilename += "." + projectSettings_.r.reference_frame;
2750
2751 // add conventional file extension
2752 sinexFilename += ".snx";
2753
2754 if (block < 1)
2755 sinex_filename = sinexFilename;
2756
2757 try {
2758 // Open output file stream. Throws runtime_error on failure.
2759 file_opener(sinex_file, sinexFilename);
2760 }
2761 catch (const std::runtime_error& e) {
2762 SignalExceptionAdjustment(e.what(), 0);
2763 }
2764
2765 dna_io_snx snx;
2766
2767 try {
2768 // Print results for adjustment in SINEX format.
2769 // Throws runtime_error on failure.
2770 snx.serialise_sinex(&sinex_file, &bstBinaryRecords_,
2771 bst_meta_, bms_meta_, estimates, variances, projectSettings_,
2773 &v_blockStationsMap_.at(block), &v_parameterStationList_.at(block),
2774 blockCount_, block,
2775 &datum_);
2776 }
2777 catch (const std::runtime_error& e) {
2778 SignalExceptionAdjustment(e.what(), 0);
2779 }
2780
2781 if (projectSettings_.a.adjust_mode == PhasedMode)
2782 // if staged, unload the block
2783 if (projectSettings_.a.stage)
2784 UnloadBlock(block, 2,
2786
2787 sinex_file.close();
2788
2789 if (!snx.warnings_exist())
2790 continue;
2791
2792 success = false;
2793
2794 sinexFilename += ".err";
2795 try {
2796 // Open output file stream. Throws runtime_error on failure.
2797 file_opener(sinex_file, sinexFilename);
2798 }
2799 catch (const std::runtime_error& e) {
2800 SignalExceptionAdjustment(e.what(), 0);
2801 }
2802
2803 snx.print_warnings(&sinex_file, sinexFilename);
2804 sinex_file.close();
2805 }
2806
2807 return success;
2808}
void print_warnings(std::ofstream *warning_file, const std::string &fileName)
void serialise_sinex(std::ofstream *snx_file, pvstn_t bstRecords, binary_file_meta_t &bst_meta, binary_file_meta_t &bms_meta, matrix_2d *estimates, matrix_2d *variances, const project_settings &p, UINT32 &measurementParams, UINT32 &unknownParams, double &sigmaZero, uint32_uint32_map *blockStationsMap, vUINT32 *blockStations_, const UINT32 &blockCount, const UINT32 &block, const CDnaDatum *datum)

References blockCount_, bms_meta_, bst_meta_, bstBinaryRecords_, datum_, DeserialiseBlockFromMappedFile(), file_opener(), measurementParams_, Phased_Block_1Mode, PhasedMode, dynadjust::iostreams::dna_io_snx::print_warnings(), projectSettings_, dynadjust::iostreams::dna_io_snx::serialise_sinex(), sf_rigorous_stns, sf_rigorous_vars, sigmaZero_, SignalExceptionAdjustment(), SimultaneousMode, unknownsCount_, UnloadBlock(), v_blockStationsMap_, v_estimatedStations_, v_normals_, v_parameterStationList_, v_rigorousStations_, v_rigorousVariances_, and dynadjust::iostreams::dna_io_snx::warnings_exist().

Referenced by ExportSinex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintEstimatedStationCoordinatestoDNAXML()

void dynadjust::networkadjust::dna_adjust::PrintEstimatedStationCoordinatestoDNAXML ( const std::string & stnFile,
INPUT_FILE_TYPE t,
bool flagUnused = false )

Definition at line 2981 of file dnaadjust.cpp.

2982{
2983 // Stations
2984 std::ofstream stn_file;
2985 try {
2986 // Create STN/XML file.
2987 file_opener(stn_file, stnFile);
2988 }
2989 catch (const std::runtime_error& e) {
2990 SignalExceptionAdjustment(e.what(), 0);
2991 }
2992
2993 try {
2994
2995 UINT32 count(static_cast<UINT32>(bstBinaryRecords_.size()));
2996 dna_stn_fields dsl, dsw;
2997
2998 std::string headerComment("Source data: Coordinates estimated from least squares adjustment.");
2999
3000 // print header
3001 switch (t)
3002 {
3003 case dynaml:
3004
3005 // Write header and comments
3006 dynaml_header(stn_file, "Station File", datum_.GetName(), datum_.GetEpoch_s());
3007 dynaml_comment(stn_file, "File type: Station file");
3008 dynaml_comment(stn_file, "Project name: " + projectSettings_.g.network_name);
3009 dynaml_comment(stn_file, headerComment);
3010 dynaml_comment(stn_file, "Adj file: " + projectSettings_.o._adj_file);
3011 break;
3012
3013 case dna:
3014
3015 // get file format field widths
3017
3018 // Write header and comments
3019 dna_header(stn_file, "3.01", "STN", datum_.GetName(), datum_.GetEpoch_s(), count);
3020 dna_comment(stn_file, "File type: Station file");
3021 dna_comment(stn_file, "Project name: " + projectSettings_.g.network_name);
3022 dna_comment(stn_file, headerComment);
3023 dna_comment(stn_file, "Adj file: " + projectSettings_.o._adj_file);
3024 break;
3025 default:
3026 break;
3027 }
3028
3029 dnaStnPtr stnPtr(new CDnaStation(datum_.GetName(), datum_.GetEpoch_s()));
3030
3031 vUINT32 vStationList;
3032
3033 switch (projectSettings_.a.adjust_mode)
3034 {
3035 case Phased_Block_1Mode:
3036 // Get stations in block 1 only
3037 vStationList = v_parameterStationList_.at(0);
3038 break;
3039 default:
3040 // Create and initialise vector with 0,1,2,...,n-2,n-1,n for
3041 // all stations in the network
3042 vStationList.resize(bstBinaryRecords_.size());
3043 initialiseIncrementingIntegerVector<UINT32>(vStationList, static_cast<UINT32>(bstBinaryRecords_.size()));
3044 }
3045
3046 // Sort on original file order
3047 CompareStnFileOrder<station_t, UINT32> stnorderCompareFunc(&bstBinaryRecords_);
3048 std::sort(vStationList.begin(), vStationList.end(), stnorderCompareFunc);
3049
3050 // print station coordinates
3051 switch (t)
3052 {
3053 case dynaml:
3054
3055 if (flagUnused)
3056 // Print stations in DynaML format
3057 for_each(vStationList.begin(), vStationList.end(),
3058 [&stn_file, &stnPtr, this](const UINT32& stn) {
3059 stnPtr->SetStationRec(bstBinaryRecords_.at(stn));
3060 if (stnPtr->IsNotUnused())
3061 stnPtr->WriteDNAXMLStnCurrentEstimates(&stn_file,
3062 datum_.GetEllipsoidRef(), &projection_, dynaml);
3063 });
3064 else
3065 // Print stations in DynaML format
3066 for_each(vStationList.begin(), vStationList.end(),
3067 [&stn_file, &stnPtr, this](const UINT32& stn) {
3068 stnPtr->SetStationRec(bstBinaryRecords_.at(stn));
3069 stnPtr->WriteDNAXMLStnCurrentEstimates(&stn_file,
3070 datum_.GetEllipsoidRef(), &projection_, dynaml);
3071 });
3072
3073 stn_file << "</DnaXmlFormat>" << std::endl;
3074
3075 break;
3076 case dna:
3077
3078 if (flagUnused)
3079 // Print stations in DNA format
3080 for_each(vStationList.begin(), vStationList.end(),
3081 [&stn_file, &stnPtr, &dsw, this](const UINT32& stn) {
3082 stnPtr->SetStationRec(bstBinaryRecords_.at(stn));
3083 if (stnPtr->IsNotUnused())
3084 stnPtr->WriteDNAXMLStnCurrentEstimates(&stn_file,
3085 datum_.GetEllipsoidRef(), &projection_, dna, &dsw);
3086 });
3087 else
3088 // Print stations in DNA format
3089 for_each(vStationList.begin(), vStationList.end(),
3090 [&stn_file, &stnPtr, &dsw, this](const UINT32& stn) {
3091 stnPtr->SetStationRec(bstBinaryRecords_.at(stn));
3092 stnPtr->WriteDNAXMLStnCurrentEstimates(&stn_file,
3093 datum_.GetEllipsoidRef(), &projection_, dna, &dsw);
3094 });
3095
3096 break;
3097 default:
3098 break;
3099 }
3100
3101
3102 stn_file.close();
3103 }
3104 catch (const std::ofstream::failure& f) {
3105 SignalExceptionAdjustment(f.what(), 0);
3106 }
3107 catch (const XMLInteropException& e) {
3109 }
3110}
virtual const char * what() const
void determineDNASTNFieldParameters(const std::string &version, dna_stn_fields &dflocs, dna_stn_fields &dfwidths)
void dna_comment(std::ostream &os, const std::string &comment)
void dna_header(std::ostream &os, const std::string &fileVersion, const std::string &fileType, const std::string &reference_frame, const std::string &epoch_version, const size_t &count)
void dynaml_comment(std::ostream &os, const std::string &comment)
void dynaml_header(std::ostream &os, const std::string &fileType, const std::string &referenceFrame, const std::string &epoch)
@ dynaml
Definition dnatypes.hpp:321
@ dna
Definition dnatypes.hpp:322
boost::shared_ptr< CDnaStation > dnaStnPtr

References bstBinaryRecords_, datum_, determineDNASTNFieldParameters(), dna, dna_comment(), dna_header(), dynaml, dynaml_comment(), dynaml_header(), file_opener(), initialiseIncrementingIntegerVector(), Phased_Block_1Mode, projectSettings_, SignalExceptionAdjustment(), and v_parameterStationList_.

Referenced by ExportDNA(), and ExportDynaML().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintEstimatedStationCoordinatestoDNAXML_Y()

void dynadjust::networkadjust::dna_adjust::PrintEstimatedStationCoordinatestoDNAXML_Y ( const std::string & msrFile,
INPUT_FILE_TYPE t )

Definition at line 2810 of file dnaadjust.cpp.

2811{
2812 // Measurements
2813 std::ofstream msr_file;
2814 try {
2815 // Create STN/XML file.
2816 file_opener(msr_file, msrFile);
2817 }
2818 catch (const std::runtime_error& e) {
2819 SignalExceptionAdjustment(e.what(), 0);
2820 }
2821
2822 dna_msr_fields dml, dmw;
2823
2824 std::stringstream ss;
2825
2826 try {
2827
2828 UINT32 count(static_cast<UINT32>(v_blockStationsMapUnique_.size()));
2829 ss << "Source data: Coordinates and uncertainties for " <<
2830 count << " unique stations in " << blockCount_ << " blocks " <<
2831 "estimated from least squares adjustment.";
2832 std::string headerComment(ss.str());
2833
2834 // print header
2835 switch (t)
2836 {
2837 case dynaml:
2838
2839 // Write header and comments
2840 dynaml_header(msr_file, "Measurement File", datum_.GetName(), datum_.GetEpoch_s());
2841 dynaml_comment(msr_file, "File type: Measurement file");
2842 dynaml_comment(msr_file, "Project name: " + projectSettings_.g.network_name);
2843 dynaml_comment(msr_file, headerComment);
2844 dynaml_comment(msr_file, "Adj file: " + projectSettings_.o._adj_file);
2845 break;
2846
2847 case dna:
2848
2849 // get file format field widths
2851
2852 // Write header and comments
2853 dna_header(msr_file, "3.01", "MSR", datum_.GetName(), datum_.GetEpoch_s(), blockCount_);
2854 dna_comment(msr_file, "File type: Measurement file");
2855 dna_comment(msr_file, "Project name: " + projectSettings_.g.network_name);
2856 dna_comment(msr_file, headerComment);
2857 dna_comment(msr_file, "Adj file: " + projectSettings_.o._adj_file);
2858 break;
2859 default:
2860 break;
2861 }
2862 }
2863 catch (const std::ofstream::failure& f) {
2864 SignalExceptionAdjustment(f.what(), 0);
2865 }
2866 catch (const XMLInteropException& e) {
2868 }
2869 catch (const std::runtime_error& e) {
2870 SignalExceptionAdjustment(e.what(), 0);
2871 }
2872
2873 try
2874 {
2875 matrix_2d *estimates = nullptr, *variances = nullptr;
2876 dnaMsrPtr msr_ptr;
2877 std::string comment;
2878
2879 // Create a Y cluster for each block
2880 for (UINT32 block(0); block<blockCount_; ++block)
2881 {
2882 // Get the appropriate coordinate and uncertainty estimates
2883 switch (projectSettings_.a.adjust_mode)
2884 {
2885 case Phased_Block_1Mode:
2886 if (block > 0)
2887 {
2888 block = blockCount_;
2889 continue;
2890 }
2891 [[fallthrough]];
2892 case PhasedMode:
2893
2894 // if staged, load up the block from memory mapped files
2895 if (projectSettings_.a.stage)
2898
2899 estimates = &v_rigorousStations_.at(block);
2900 variances = &v_rigorousVariances_.at(block);
2901 break;
2902 case SimultaneousMode:
2903 estimates = &v_estimatedStations_.at(block);
2904 variances = &v_normals_.at(block);
2905 }
2906
2907 msr_ptr.reset(new CDnaGpsPointCluster(block, datum_.GetName(), datum_.GetEpoch_s()));
2908 msr_ptr.get()->PopulateMsr(&bstBinaryRecords_,
2909 &v_blockStationsMap_.at(block), &v_parameterStationList_.at(block),
2910 block, &datum_, estimates, variances);
2911
2912 if (projectSettings_.a.adjust_mode == PhasedMode)
2913 // if staged, unload the block
2914 if (projectSettings_.a.stage)
2915 UnloadBlock(block, 2,
2917
2918 ss.str("");
2919
2920 // print station coordinate estimates as a GNSS Y cluster
2921 switch (t)
2922 {
2923 case dynaml:
2924 ss << std::endl <<
2925 " - Estimated station coordinates and uncertainties";
2926 if (blockCount_ > 1)
2927 ss << " for block " << (block + 1);
2928 ss << std::endl <<
2929 " - Type (Y) GPS point cluster (set of " << v_blockStationsMap_.at(block).size() << " stations)";
2930 if (blockCount_ > 1)
2931 {
2932 ss << ":" << std::endl <<
2933 " - " << v_ISL_.at(block).size() << " inner station";
2934 if (v_ISL_.at(block).size() != 1)
2935 ss << "s";
2936 ss << std::endl <<
2937 " - " << v_JSL_.at(block).size() << " junction station";
2938 if (v_JSL_.at(block).size() != 1)
2939 ss << "s";
2940 ss << std::endl;
2941 }
2942 else
2943 ss << std::endl;
2944
2945 ss << " ";
2946 comment = ss.str();
2947 // Print station coordinate estimates in DynaML format
2948 msr_ptr.get()->WriteDynaMLMsr(&msr_file, comment);
2949 break;
2950 case dna:
2951 // Print station coordinate estimates in DNA format
2952 msr_ptr.get()->WriteDNAMsr(&msr_file, dmw, dml);
2953 break;
2954 default:
2955 break;
2956 }
2957 }
2958
2959 switch (t)
2960 {
2961 case dynaml:
2962 msr_file << "</DnaXmlFormat>" << std::endl;
2963 break;
2964 case dna:
2965 default:
2966 break;
2967 }
2968
2969 msr_file.close();
2970 }
2971 catch (const std::ofstream::failure& f) {
2972 SignalExceptionAdjustment(f.what(), 0);
2973 }
2974 catch (const XMLInteropException& e) {
2976 }
2977}
v_u32u32_uint32_pair v_blockStationsMapUnique_
void determineDNAMSRFieldParameters(const std::string &version, dna_msr_fields &dflocs, dna_msr_fields &dfwidths, const U u=0)
boost::shared_ptr< CDnaMeasurement > dnaMsrPtr

References blockCount_, bstBinaryRecords_, datum_, DeserialiseBlockFromMappedFile(), determineDNAMSRFieldParameters(), dna, dna_comment(), dna_header(), dynaml, dynaml_comment(), dynaml_header(), file_opener(), Phased_Block_1Mode, PhasedMode, projectSettings_, sf_rigorous_stns, sf_rigorous_vars, SignalExceptionAdjustment(), SimultaneousMode, UnloadBlock(), v_blockStationsMap_, v_blockStationsMapUnique_, v_estimatedStations_, v_ISL_, v_JSL_, v_normals_, v_parameterStationList_, v_rigorousStations_, and v_rigorousVariances_.

Referenced by ExportDNA(), and ExportDynaML().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CloseOutputFiles()

void dynadjust::networkadjust::dna_adjust::CloseOutputFiles ( )

Definition at line 3352 of file dnaadjust.cpp.

3353{
3354 adj_file.close();
3355 xyz_file.close();
3356
3357 if (projectSettings_.g.verbose > 0)
3358 debug_file.close();
3359}

References adj_file, debug_file, projectSettings_, and xyz_file.

Referenced by main().

Here is the caller graph for this function:

◆ UpdateBinaryFiles()

void dynadjust::networkadjust::dna_adjust::UpdateBinaryFiles ( )

Definition at line 447 of file dnaadjust.cpp.

448{
449 snprintf(bst_meta_.modifiedBy, sizeof(bst_meta_.modifiedBy), "%s", __BINARY_NAME__);
450 bst_meta_.reduced = true;
451
452 try {
453 // Write binary stations data. Throws runtime_error on failure.
454 dna_io_bst bst;
456 }
457 catch (const std::runtime_error& e) {
458 SignalExceptionAdjustment(e.what(), 0);
459 }
460
461 snprintf(bms_meta_.modifiedBy, sizeof(bms_meta_.modifiedBy), "%s", __BINARY_NAME__);
462 bms_meta_.reduced = true;
463
464 try {
465 // Write binary measurements data. Throws runtime_error on failure.
466 dna_io_bms bms;
468 }
469 catch (const std::runtime_error& e) {
470 SignalExceptionAdjustment(e.what(), 0);
471 }
472}
void write_bms_file(const std::string &bms_filename, pvmsr_t vbinary_msr, binary_file_meta_t &bms_meta)
Definition dnaiobms.cpp:166
void write_bst_file(const std::string &bst_filename, pvstn_t vbinary_stn, binary_file_meta_t &bst_meta)
Definition dnaiobst.cpp:167

References bms_meta_, bmsBinaryRecords_, bst_meta_, bstBinaryRecords_, projectSettings_, SignalExceptionAdjustment(), dynadjust::iostreams::dna_io_bms::write_bms_file(), and dynadjust::iostreams::dna_io_bst::write_bst_file().

Referenced by UpdateBinaryFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CurrentIteration()

UINT32 dynadjust::networkadjust::dna_adjust::CurrentIteration ( ) const

Definition at line 175 of file dnaadjust.cpp.

176{
177 boost::lock_guard<boost::mutex> lock(current_iterationMutex);
178 return currentIteration_;
179}
boost::mutex current_iterationMutex
Definition dnaadjust.cpp:42

References dynadjust::networkadjust::current_iterationMutex, and currentIteration_.

Referenced by AdjustPhased(), AdjustPhasedBlock1(), AdjustPhasedMultiThread(), AdjustSimultaneous(), PrintAdjMeasurements(), PrintAdjustmentStatus(), PrintSummaryMessage(), and ValidateandFinaliseAdjustment().

Here is the caller graph for this function:

◆ incrementIteration()

UINT32 & dynadjust::networkadjust::dna_adjust::incrementIteration ( )

Definition at line 181 of file dnaadjust.cpp.

182{
183 boost::lock_guard<boost::mutex> lock(current_iterationMutex);
184 return ++currentIteration_;
185}

References dynadjust::networkadjust::current_iterationMutex, and currentIteration_.

Referenced by AdjustPhased(), AdjustPhasedMultiThread(), and AdjustSimultaneous().

Here is the caller graph for this function:

◆ initialiseIteration()

void dynadjust::networkadjust::dna_adjust::initialiseIteration ( const UINT32 & iteration = 0)

Definition at line 187 of file dnaadjust.cpp.

188{
189 boost::lock_guard<boost::mutex> lock(current_iterationMutex);
190 currentIteration_ = iteration;
191}

References dynadjust::networkadjust::current_iterationMutex, and currentIteration_.

Referenced by AdjustPhased(), AdjustPhasedBlock1(), AdjustPhasedMultiThread(), AdjustSimultaneous(), and InitialiseAdjustment().

Here is the caller graph for this function:

◆ CurrentBlock()

UINT32 dynadjust::networkadjust::dna_adjust::CurrentBlock ( ) const
inline

Definition at line 288 of file dnaadjust.hpp.

288{ return currentBlock_; };

References currentBlock_.

◆ SetcurrentBlock()

void dynadjust::networkadjust::dna_adjust::SetcurrentBlock ( const UINT32 b)
inline

Definition at line 290 of file dnaadjust.hpp.

290{ currentBlock_ = b; };

References currentBlock_.

Referenced by AdjustPhasedForward(), AdjustPhasedMultiThread(), AdjustPhasedReverse(), AdjustPhasedReverseCombine(), and PrepareAdjustment().

Here is the caller graph for this function:

◆ SetmaxCorr()

void dynadjust::networkadjust::dna_adjust::SetmaxCorr ( const double c)
inline

Definition at line 292 of file dnaadjust.hpp.

292 {
293
294 boost::lock_guard<boost::mutex> lock(maxCorrMutex);
295 maxCorr_ = c;
296 };
boost::mutex maxCorrMutex
Definition dnaadjust.cpp:42

References maxCorr_, and dynadjust::networkadjust::maxCorrMutex.

Referenced by UpdateEstimatesFinal(), and UpdateEstimatesForward().

Here is the caller graph for this function:

◆ blockCount()

UINT32 dynadjust::networkadjust::dna_adjust::blockCount ( ) const
inline

Definition at line 298 of file dnaadjust.hpp.

298{ return blockCount_; }

References blockCount_.

Referenced by PrintSummaryMessage().

Here is the caller graph for this function:

◆ adjustTime()

boost::posix_time::milliseconds dynadjust::networkadjust::dna_adjust::adjustTime ( ) const
inline

Definition at line 299 of file dnaadjust.hpp.

299 {
300 return total_time_;
301 }

References total_time_.

Referenced by main().

Here is the caller graph for this function:

◆ processingForward()

bool dynadjust::networkadjust::dna_adjust::processingForward ( )
inline

Definition at line 302 of file dnaadjust.hpp.

302{ return forward_; }

References forward_.

◆ processingCombine()

bool dynadjust::networkadjust::dna_adjust::processingCombine ( )
inline

Definition at line 303 of file dnaadjust.hpp.

303{ return isCombining_; }

References isCombining_.

◆ GetDegreesOfFreedom()

int dynadjust::networkadjust::dna_adjust::GetDegreesOfFreedom ( ) const
inline

Definition at line 304 of file dnaadjust.hpp.

304{ return degreesofFreedom_; }

References degreesofFreedom_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetMeasurementCount()

UINT32 dynadjust::networkadjust::dna_adjust::GetMeasurementCount ( ) const
inline

Definition at line 305 of file dnaadjust.hpp.

305{ return measurementParams_; }

References measurementParams_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetUnknownsCount()

UINT32 dynadjust::networkadjust::dna_adjust::GetUnknownsCount ( ) const
inline

Definition at line 306 of file dnaadjust.hpp.

306{ return unknownParams_; }

References unknownParams_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetChiSquared()

double dynadjust::networkadjust::dna_adjust::GetChiSquared ( ) const
inline

Definition at line 307 of file dnaadjust.hpp.

307{ return chiSquared_; }

References chiSquared_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetSigmaZero()

double dynadjust::networkadjust::dna_adjust::GetSigmaZero ( ) const
inline

Definition at line 308 of file dnaadjust.hpp.

308{ return sigmaZero_; }

References sigmaZero_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetPotentialOutlierCount()

UINT32 dynadjust::networkadjust::dna_adjust::GetPotentialOutlierCount ( ) const
inline

Definition at line 309 of file dnaadjust.hpp.

309 {
311 }

References potentialOutlierCount_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetChiSquaredUpperLimit()

double dynadjust::networkadjust::dna_adjust::GetChiSquaredUpperLimit ( ) const
inline

Definition at line 312 of file dnaadjust.hpp.

312 {
314 }

References chiSquaredUpperLimit_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetChiSquaredLowerLimit()

double dynadjust::networkadjust::dna_adjust::GetChiSquaredLowerLimit ( ) const
inline

Definition at line 315 of file dnaadjust.hpp.

315 {
317 }

References chiSquaredLowerLimit_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetGlobalPelzerRel()

double dynadjust::networkadjust::dna_adjust::GetGlobalPelzerRel ( ) const
inline

Definition at line 318 of file dnaadjust.hpp.

318 {
320 }

References globalPelzerReliability_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetTestResult()

UINT32 dynadjust::networkadjust::dna_adjust::GetTestResult ( ) const
inline

Definition at line 321 of file dnaadjust.hpp.

321{ return passFail_; }

References passFail_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetAllFixed()

bool dynadjust::networkadjust::dna_adjust::GetAllFixed ( ) const
inline

Definition at line 322 of file dnaadjust.hpp.

322{ return allStationsFixed_; }

References allStationsFixed_.

Referenced by GenerateStatistics().

Here is the caller graph for this function:

◆ GetMemoryFootprint()

void dynadjust::networkadjust::dna_adjust::GetMemoryFootprint ( double & memory,
const _MEM_UNIT_ unit )

Definition at line 621 of file dnaadjust.cpp.

622{
624 UINT32 precision(2);
625 size_t size(0);
626
627 std::stringstream ss, st;
628 if (projectSettings_.g.verbose > 0)
629 {
630 // Print title
631 ss << std::endl << std::left << std::setw(PRINT_VAR_PAD) << "+ Memory footprint:";
632 st << "Size";
633 switch (unit)
634 {
635 case GIGABYTE_SIZE:
636 st << "(GB) ";
637 precision = 2;
638 break;
639 case MEGABYTE_SIZE:
640 st << "(MB) ";
641 precision = 1;
642 break;
643 case KILOBYTE_SIZE:
644 default:
645 st << "(kB) ";
646 precision = 0;
647 break;
648 }
649
650 ss << std::right << std::setw(NUMERIC_WIDTH) << st.str() << std::endl;
651
652 // Print line
653 ss << " ";
654 for (i=0; i<w; ++i)
655 ss << "-";
656 ss << std::endl;
657 }
658
659 double tmp;
660 memory = 0.0;
661
663 // binary stations
664 memory += (tmp = static_cast<double>(bstBinaryRecords_.size()) / unit * sizeof(station_t));
665 if (projectSettings_.g.verbose > 0)
666 ss << std::left << std::setw(PRINT_VAR_PAD) << " Binary station file" <<
667 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
669
671 // binary measurements
672 memory += (tmp = static_cast<double>(bmsBinaryRecords_.size()) / unit * sizeof(measurement_t));
673 if (projectSettings_.g.verbose > 0)
674 ss << std::left << std::setw(PRINT_VAR_PAD) << " Binary measurement file" <<
675 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
677
679 // Associated Station List
680 memory += (tmp = static_cast<double>(vAssocStnList_.size()) / unit * sizeof(CAStationList));
681 if (projectSettings_.g.verbose > 0)
682 ss << std::left << std::setw(PRINT_VAR_PAD) << " Associated station list" <<
683 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
685
687 // Associated Measurement List
688 memory += (tmp = static_cast<double>(vAssocMsrList_.size()) / unit * sizeof(UINT32));
689 if (projectSettings_.g.verbose > 0)
690 ss << std::left << std::setw(PRINT_VAR_PAD) << " Associated measurement list" <<
691 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
693
695 // double type variables
696 size = 0;
697 size += v_sigmaZero_.size();
698 size += v_chiSquaredUpperLimit_.size();
699 size += v_chiSquaredLowerLimit_.size();
700 memory += (tmp = static_cast<double>(size) / unit * sizeof(double));
701 if (projectSettings_.g.verbose > 0)
702 ss << std::left << std::setw(PRINT_VAR_PAD) << " Statistical variables" <<
703 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
705
707 // matrix_2d type variables
708 tmp = 0;
709 for (b=0; b<blockCount_; ++b)
710 {
711 tmp += (static_cast<double>(v_originalStations_.at(b).get_size()));
712 tmp += (static_cast<double>(v_design_.at(b).get_size()));
713 tmp += (static_cast<double>(v_measMinusComp_.at(b).get_size()));
714 tmp += (static_cast<double>(v_AtVinv_.at(b).get_size()));
715 tmp += (static_cast<double>(v_normals_.at(b).get_size()));
716 tmp += (static_cast<double>(v_estimatedStations_.at(b).get_size()));
717
718 if (projectSettings_.a.adjust_mode == PhasedMode)
719 {
720 tmp += (static_cast<double>(v_rigorousStations_.at(b).get_size()));
721 tmp += (static_cast<double>(v_junctionVariances_.at(b).get_size()));
722 tmp += (static_cast<double>(v_junctionVariancesFwd_.at(b).get_size()));
723 tmp += (static_cast<double>(v_junctionEstimatesFwd_.at(b).get_size()));
724 tmp += (static_cast<double>(v_junctionEstimatesRev_.at(b).get_size()));
725 }
726 tmp += (static_cast<double>(v_rigorousVariances_.at(b).get_size()));
727 tmp += (static_cast<double>(v_precAdjMsrsFull_.at(b).get_size()));
728 tmp += (static_cast<double>(v_corrections_.at(b).get_size()));
729 }
730
731 tmp *= sizeof(double);
732 tmp /= unit;
733 memory += tmp;
734
735 if (projectSettings_.g.verbose > 0)
736 ss << std::left << std::setw(PRINT_VAR_PAD) << " Matrix variables" <<
737 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
738
739 if (projectSettings_.a.multi_thread)
740 {
741 tmp = 0;
742 for (b=0; b<blockCount_; ++b)
743 {
744 if (!v_designR_.empty())
745 tmp += (static_cast<double>(v_designR_.at(b).get_size()));
746 if (!v_measMinusCompR_.empty())
747 tmp += (static_cast<double>(v_measMinusCompR_.at(b).get_size()));
748 if (!v_AtVinvR_.empty())
749 tmp += (static_cast<double>(v_AtVinvR_.at(b).get_size()));
750 if (!v_normalsR_.empty())
751 tmp += (static_cast<double>(v_normalsR_.at(b).get_size()));
752 if (!v_estimatedStationsR_.empty())
753 tmp += (static_cast<double>(v_estimatedStationsR_.at(b).get_size()));
754 if (!v_junctionVariancesR_.empty())
755 tmp += (static_cast<double>(v_junctionVariancesR_.at(b).get_size()));
756 if (!v_normalsRC_.empty())
757 tmp += (static_cast<double>(v_normalsRC_.at(b).get_size()));
758 if (!v_correctionsR_.empty())
759 tmp += (static_cast<double>(v_correctionsR_.at(b).get_size()));
760 }
761
762 tmp *= sizeof(double);
763 tmp /= unit;
764 memory += tmp;
765
766 if (projectSettings_.g.verbose > 0)
767 ss << std::left << std::setw(PRINT_VAR_PAD) << " MT matrix variables" <<
768 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
769 }
770
772
774 // UINT32
775 size = 0;
776 size += v_ContiguousNetList_.size();
777 size += v_pseudoMeasCountFwd_.size();
778 size += v_measurementParams_.size();
779 size += v_measurementCount_.size();
780 size += v_measurementVarianceCount_.size();
781 size += v_unknownParams_.size();
782 size += v_unknownsCount_.size();
783 size += v_parameterStationCount_.size();
784
785 for (b=0; b<blockCount_; ++b)
786 {
787 size += v_ISL_.at(b).size();
788 if (projectSettings_.a.adjust_mode == PhasedMode)
789 {
790 size += v_JSL_.at(b).size();
791 size += v_CML_.at(b).size();
792 }
793 size += v_parameterStationList_.at(b).size();
794 }
795 tmp = static_cast<double>(size);
796 tmp *= sizeof(UINT32);
797 tmp /= unit;
798 memory += tmp;
799
800 if (projectSettings_.g.verbose > 0)
801 ss << std::left << std::setw(PRINT_VAR_PAD) << " Arrays, counters and indices" <<
802 std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << tmp << std::endl;
804
805
806 if (projectSettings_.g.verbose > 0)
807 {
808 ss << " ";
809 for (i=0; i<w; ++i)
810 ss << "-";
811 ss << std::endl;
812 ss << std::left << std::setw(PRINT_VAR_PAD) << " Total" << std::right << std::setw(NUMERIC_WIDTH) << std::fixed << std::setprecision(precision) << memory << std::endl << std::endl;
813 debug_file << ss.str();
814 }
815}
const UINT32 NUMERIC_WIDTH(8)
@ KILOBYTE_SIZE
@ MEGABYTE_SIZE
struct stn_t station_t
struct dynadjust::measurements::msr_t measurement_t

References blockCount_, bmsBinaryRecords_, bstBinaryRecords_, debug_file, GIGABYTE_SIZE, KILOBYTE_SIZE, MEGABYTE_SIZE, NUMERIC_WIDTH(), PhasedMode, PRINT_VAR_PAD(), projectSettings_, v_AtVinv_, v_AtVinvR_, v_chiSquaredLowerLimit_, v_chiSquaredUpperLimit_, v_CML_, v_ContiguousNetList_, v_corrections_, v_correctionsR_, v_design_, v_designR_, v_estimatedStations_, v_estimatedStationsR_, v_ISL_, v_JSL_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_junctionVariancesR_, v_measMinusComp_, v_measMinusCompR_, v_measurementCount_, v_measurementParams_, v_measurementVarianceCount_, v_normals_, v_normalsR_, v_normalsRC_, v_originalStations_, v_parameterStationCount_, v_parameterStationList_, v_precAdjMsrsFull_, v_pseudoMeasCountFwd_, v_rigorousStations_, v_rigorousVariances_, v_sigmaZero_, v_unknownParams_, v_unknownsCount_, vAssocMsrList_, and vAssocStnList_.

Referenced by PrepareAdjustment(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSegmentationFileParameters()

void dynadjust::networkadjust::dna_adjust::LoadSegmentationFileParameters ( const std::string & seg_filename)

Definition at line 14821 of file dnaadjust.cpp.

14822{
14823 UINT32 blockThreshold, minInnerStns;
14824
14825 try {
14826 // Load segmentation file. Throws runtime_error on failure.
14827 dna_io_seg seg;
14828 seg.load_seg_file_header_f(seg_filename,
14829 blockCount_, blockThreshold, minInnerStns);
14830 }
14831 catch (const std::runtime_error& e) {
14832 SignalExceptionAdjustment(e.what(), 0);
14833 }
14834}
void load_seg_file_header_f(const std::string &seg_filename, UINT32 &blockCount, UINT32 &blockThreshold, UINT32 &minInnerStns)
Definition dnaioseg.cpp:28

References blockCount_, dynadjust::iostreams::dna_io_seg::load_seg_file_header_f(), and SignalExceptionAdjustment().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SerialiseAdjustedVarianceMatrices()

void dynadjust::networkadjust::dna_adjust::SerialiseAdjustedVarianceMatrices ( )

Definition at line 7765 of file dnaadjust.cpp.

7766{
7767 // No need to facilitate serialising if network adjustment is in stage,
7768 // as this will already be taken care of
7769 if (projectSettings_.a.stage)
7770 return;
7771
7772 // Create file streams and memory map regions
7773 projectSettings_.a.recreate_stage_files = 1;
7776
7777 // Now offload matrices to new .mtx stage files
7778
7779 UINT32 block;
7780
7781 for (block=0; block<blockCount_; ++block)
7782 {
7783 // Set memory mapped file region offsets
7785
7786 // Write to disk (the memory mapped file)
7787 f_rigorousVariances_ << v_rigorousVariances_.at(block); // ...rva.mtx
7788 f_precAdjMsrs_ << v_precAdjMsrsFull_.at(block); // ...pam.mtx
7789 }
7790
7791 // Close rigorous variances stream
7792 f_rigorousVariances_.close();
7793 f_precAdjMsrs_.close();
7794}
void ReserveBlockMapRegions(const int file_count=0,...)
void OpenStageFileStreams(const int file_count=0,...)
@ sf_prec_adj_msrs
Definition dnatypes.hpp:462

References blockCount_, f_precAdjMsrs_, f_rigorousVariances_, OpenStageFileStreams(), projectSettings_, ReserveBlockMapRegions(), SetRegionOffsets(), sf_prec_adj_msrs, sf_rigorous_vars, v_precAdjMsrsFull_, and v_rigorousVariances_.

Referenced by SerialiseVarianceMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeSerialiseAdjustedVarianceMatrices()

void dynadjust::networkadjust::dna_adjust::DeSerialiseAdjustedVarianceMatrices ( )

Definition at line 7715 of file dnaadjust.cpp.

7716{
7717 // No need to facilitate serialising if network adjustment is in stage,
7718 // as this will already be taken care of
7719 if (projectSettings_.a.stage)
7720 return;
7721
7722 // Create file streams and memory map regions
7725
7726 for (UINT32 block=0; block<blockCount_; ++block)
7727 {
7728 // Set Region offsets
7730
7731 // Prepare mapping regions
7733 }
7734
7735
7736 try {
7737 // Set memory mapped file regions
7738 // NOTE - previously created files must exist and match the
7739 // dimensions of the current matrix sizes
7741
7742 }
7743 catch (boost::interprocess::interprocess_exception& e){
7744 std::stringstream ss;
7745 ss << "DeSerialiseAdjustedVarianceMatrices() terminated while creating memory map" << std::endl;
7746 ss << " regions from mtx file. Details:\n " << e.what() << std::endl;
7747 adj_file << std::endl << "- Error: " << ss.str() << std::endl;
7748 SignalExceptionAdjustment(ss.str(), 0);
7749 }
7750
7751 // Now load up matrix from .mtx file
7752 for (UINT32 block=0; block<blockCount_; ++block)
7753 {
7754 // Read this block
7757 }
7758
7759 // Close rigorous variances stream
7760 f_rigorousVariances_.close();
7761 f_precAdjMsrs_.close();
7762}
void PrepareMemoryMapRegions(const UINT32 &block, const int file_count=0,...)

References adj_file, blockCount_, DeserialiseBlockFromMappedFile(), f_precAdjMsrs_, f_rigorousVariances_, OpenStageFileStreams(), PrepareMemoryMapRegions(), projectSettings_, ReserveBlockMapRegions(), SetMapRegions(), SetRegionOffsets(), sf_prec_adj_msrs, sf_rigorous_vars, and SignalExceptionAdjustment().

Referenced by DeserialiseVarianceMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ NewMessagesAvailable()

bool dynadjust::networkadjust::dna_adjust::NewMessagesAvailable ( )
inline

Definition at line 333 of file dnaadjust.hpp.

333{ return iterationQueue_.not_empty(); }
concurrent_queue< UINT32 > iterationQueue_

References iterationQueue_.

Referenced by PrintSummaryMessage().

Here is the caller graph for this function:

◆ GetMessageIteration()

bool dynadjust::networkadjust::dna_adjust::GetMessageIteration ( UINT32 & iteration)
inline

Definition at line 334 of file dnaadjust.hpp.

334 {
335 return iterationQueue_.front_and_pop(iteration);
336 }

References iterationQueue_.

Referenced by PrintSummaryMessage().

Here is the caller graph for this function:

◆ GetMaxCorrection()

std::string dynadjust::networkadjust::dna_adjust::GetMaxCorrection ( const UINT32 & iteration) const
inline

Definition at line 339 of file dnaadjust.hpp.

339 {
340 if (iteration == 0)
341 return iterationCorrections_.get_message(iteration); // safe guard
342 return iterationCorrections_.get_message(iteration - 1);
343 };
message_bank< std::string > iterationCorrections_

References iterationCorrections_.

Referenced by PrintSummaryMessage().

Here is the caller graph for this function:

◆ ThreadSafeWritetoAdjFile()

void dynadjust::networkadjust::dna_adjust::ThreadSafeWritetoAdjFile ( const std::string & s)
inline

Definition at line 348 of file dnaadjust.hpp.

348 {
350 }
concurrent_ofstream< std::string > concurrent_adj_ofstream

References adj_file, and concurrent_adj_ofstream.

Referenced by WriteMsrtoAdjFile(), WriteStatstoAdjFile(), and WriteStntoAdjFile().

Here is the caller graph for this function:

◆ WriteStatstoAdjFile()

void dynadjust::networkadjust::dna_adjust::WriteStatstoAdjFile ( const std::string & s)
inline

Definition at line 351 of file dnaadjust.hpp.

351 {
352 if (projectSettings_.o._adj_stat_iteration)
354 }
void ThreadSafeWritetoAdjFile(const std::string &s)

References projectSettings_, and ThreadSafeWritetoAdjFile().

Here is the call graph for this function:

◆ WriteStntoAdjFile()

void dynadjust::networkadjust::dna_adjust::WriteStntoAdjFile ( const std::string & s)
inline

Definition at line 355 of file dnaadjust.hpp.

355 {
356 if (projectSettings_.o._adj_stn_iteration)
358 }

References projectSettings_, and ThreadSafeWritetoAdjFile().

Here is the call graph for this function:

◆ WriteMsrtoAdjFile()

void dynadjust::networkadjust::dna_adjust::WriteMsrtoAdjFile ( const std::string & s)
inline

Definition at line 359 of file dnaadjust.hpp.

359 {
360 if (projectSettings_.o._adj_msr_iteration)
362 }

References projectSettings_, and ThreadSafeWritetoAdjFile().

Here is the call graph for this function:

◆ ThreadSafeWritetoDbgFile()

void dynadjust::networkadjust::dna_adjust::ThreadSafeWritetoDbgFile ( const std::string & s)
inline

Definition at line 364 of file dnaadjust.hpp.

364 {
366 }

References concurrent_adj_ofstream, and debug_file.

◆ AdjustNetwork()

_ADJUST_STATUS_ dynadjust::networkadjust::dna_adjust::AdjustNetwork ( )

Definition at line 2308 of file dnaadjust.cpp.

2309{
2310 isAdjusting_ = true;
2311 isIterationComplete_ = false;
2313 iterationCorrections_.clear_messages();
2314
2315 if (projectSettings_.o._database_ids)
2317
2318 switch (projectSettings_.a.adjust_mode)
2319 {
2320 case SimultaneousMode:
2321 if (!projectSettings_.a.report_mode)
2322 adj_file << std::endl << "+ Commencing simultaneous adjustment" << std::endl << std::endl;
2324 return adjustStatus_;
2325
2326 case PhasedMode:
2327 if (!projectSettings_.a.report_mode)
2328 adj_file << std::endl << "+ Commencing sequential phased adjustment";
2329
2330 if (projectSettings_.a.multi_thread)
2331 {
2332 if (!projectSettings_.a.report_mode)
2333 {
2334 adj_file << std::endl << " Optimised for concurrent processing via multi-threading." << std::endl;
2335 adj_file << " The active CPU supports the execution of " << boost::thread::hardware_concurrency() << " concurrent threads." << std::endl;
2336 adj_file << std::endl;
2337 }
2339 return adjustStatus_;
2340 }
2341
2342 if (!projectSettings_.a.report_mode)
2343 adj_file << std::endl << std::endl;
2344 AdjustPhased();
2345
2346 return adjustStatus_;
2347
2348 case Phased_Block_1Mode:
2349 if (!projectSettings_.a.report_mode)
2350 {
2351 adj_file << std::endl << "+ Commencing sequential phased adjustment, producing rigorous estimates" << std::endl;
2352 adj_file << " for block 1 only" << std::endl << std::endl;
2353 adj_file <<
2354 "- Warning: Depending on the quality of the apriori station estimates, further" << std::endl <<
2355 " iterations may be needed. --block1-phased mode should only be used once" << std::endl <<
2356 " rigorous estimates have been produced for the entire network."<< std::endl << std::endl;
2357 }
2358
2360 return adjustStatus_;
2361
2362 default:
2363 std::stringstream ss;
2364 ss << "AdjustNetwork(): Unknown adjustment type" << std::endl;
2365 SignalExceptionAdjustment(ss.str(), 0);
2366 }
2367
2368 return adjustStatus_;
2369}

References adj_file, AdjustPhased(), AdjustPhasedBlock1(), AdjustPhasedMultiThread(), AdjustSimultaneous(), adjustStatus_, isAdjusting_, isAdjustmentQuestionable_, isIterationComplete_, iterationCorrections_, LoadDatabaseId(), Phased_Block_1Mode, PhasedMode, projectSettings_, SignalExceptionAdjustment(), and SimultaneousMode.

Here is the call graph for this function:

◆ FirstBlock()

bool dynadjust::networkadjust::dna_adjust::FirstBlock ( const UINT32 & block) const
inline

Definition at line 387 of file dnaadjust.hpp.

387 {
388 return v_blockMeta_.at(block)._blockFirst;
389 }

References v_blockMeta_.

◆ LastBlock()

bool dynadjust::networkadjust::dna_adjust::LastBlock ( const UINT32 & block) const
inline

Definition at line 391 of file dnaadjust.hpp.

391 {
392 return v_blockMeta_.at(block)._blockLast;
393 }

References v_blockMeta_.

◆ SignalExceptionAdjustment()

void dynadjust::networkadjust::dna_adjust::SignalExceptionAdjustment ( const std::string & msg,
const UINT32 block_no )

Definition at line 14018 of file dnaadjust.cpp.

14019{
14021
14022 isPreparing_ = false;
14023 isCombining_ = false;
14024 isAdjusting_ = false;
14025
14026 std::string error_msg(msg);
14027
14028 switch (projectSettings_.a.adjust_mode)
14029 {
14030 case Phased_Block_1Mode:
14031 case PhasedMode:
14032 std::stringstream ss;
14033 ss << msg << std::endl << " Phased adjustment terminated whilst processing block " << block_no + 1 << std::endl;
14034 error_msg = ss.str();
14035 }
14036
14037 throw boost::enable_current_exception(std::runtime_error(error_msg));
14038}

References ADJUST_EXCEPTION_RAISED, adjustStatus_, isAdjusting_, isCombining_, isPreparing_, Phased_Block_1Mode, PhasedMode, and projectSettings_.

Referenced by AdjustNetwork(), ApplyAdditionalConstraints(), ComputePrecisionAdjMsrs(), CreateMsrToStnTally(), DeSerialiseAdjustedVarianceMatrices(), FormInverseVarianceMatrixReduced(), InitialiseTypeBUncertainties(), LoadDatabaseId(), LoadNetworkFiles(), LoadPhasedBlocks(), LoadSegmentationFile(), LoadSegmentationFileParameters(), LoadSegmentationMetrics(), LoadStationMap(), LoadVarianceMatrix_D(), LoadVarianceMatrix_G(), LoadVarianceMatrix_X(), LoadVarianceMatrix_Y(), OpenOutputFileStreams(), OpenStageFileStreams(), PrepareAdjustment(), PrintAdjMeasurements(), PrintAdjStations(), PrintAdjStationsUniqueList(), PrintEstimatedStationCoordinatestoDNAXML(), PrintEstimatedStationCoordinatestoDNAXML_Y(), PrintEstimatedStationCoordinatestoSNX(), PrintNetworkStationCorrections(), PrintPositionalUncertainty(), SerialiseBlockToDisk(), SetDefaultReferenceFrame(), Solve(), SolveMTTry(), SolveTry(), UpdateAdjustment(), UpdateBinaryFiles(), UpdateDesignNormalMeasMatrices(), UpdateDesignNormalMeasMatrices_D(), UpdateIgnoredMeasurements(), UpdateIgnoredMeasurements_A(), UpdateIgnoredMeasurements_D(), UpdateIgnoredMeasurements_S(), and UpdateNormals().

Here is the caller graph for this function:

◆ CreateMeasurementTally()

void dynadjust::networkadjust::dna_adjust::CreateMeasurementTally ( const UINT32 & block = 0)

Definition at line 241 of file dnaadjust.cpp.

242{
243 v_msrTally_.at(block).CreateTally(bmsBinaryRecords_, v_CML_.at(block));
244}

References bmsBinaryRecords_, v_CML_, and v_msrTally_.

Referenced by PrepareAdjustment().

Here is the caller graph for this function:

◆ SolveTry()

void dynadjust::networkadjust::dna_adjust::SolveTry ( bool COMPUTE_INVERSE,
const UINT32 & block = 0 )

Definition at line 7562 of file dnaadjust.cpp.

7563{
7564 // Least Squares Solution
7565 try {
7566 Solve(COMPUTE_INVERSE, block);
7567 }
7568 catch (const std::runtime_error& e) {
7569
7570 // debug matrices if required
7572
7573 // Could not invert matrix. Fire an exception
7574 SignalExceptionAdjustment(e.what(), block);
7575 }
7576}
void Solve(bool COMPUTE_INVERSE, const UINT32 &block=0)
void debug_SolutionInformation(const UINT32 &currentBlock)

References debug_SolutionInformation(), SignalExceptionAdjustment(), and Solve().

Referenced by AdjustPhasedForward(), AdjustPhasedReverse(), AdjustPhasedReverseCombine(), and AdjustSimultaneous().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SolveMTTry()

void dynadjust::networkadjust::dna_adjust::SolveMTTry ( bool COMPUTE_INVERSE,
const UINT32 & block = 0 )

Definition at line 274 of file dnaadjust-multi.cpp.

275{
276 // Least Squares Solution
277 try {
278 SolveMT(COMPUTE_INVERSE, block);
279 }
280 catch (const std::runtime_error& e) {
281
282 // could not invert matrix. throw error
283
284 if (projectSettings_.g.verbose)
285 {
286 debug_file << "Block " << block + 1 << " (reverse, multi-thread)" << std::endl;
287 debug_file << "Pre-adjustment Estimates" << std::fixed << std::setprecision(16) << v_estimatedStationsR_.at(block);
288 debug_file << "Design" << std::fixed << std::setprecision(16) << v_designR_.at(block);
289 debug_file << "Measurements" << std::fixed << std::setprecision(16) << v_measMinusCompR_.at(block);
290 debug_file << "At * V-inv" << std::fixed << std::setprecision(16) << v_AtVinvR_.at(block);
291 debug_file << "Normals " << std::fixed << std::setprecision(16) << v_normalsR_.at(block) << std::endl;
292 debug_file.flush();
293 }
294
295 SignalExceptionAdjustment(e.what(), block);
296 }
297}
void SolveMT(bool COMPUTE_INVERSE, const UINT32 &block)

References debug_file, projectSettings_, SignalExceptionAdjustment(), SolveMT(), v_AtVinvR_, v_designR_, v_estimatedStationsR_, v_measMinusCompR_, and v_normalsR_.

Here is the call graph for this function:

◆ Solve()

void dynadjust::networkadjust::dna_adjust::Solve ( bool COMPUTE_INVERSE,
const UINT32 & block = 0 )

Definition at line 7579 of file dnaadjust.cpp.

7580{
7581 // debug matrices if required
7583
7584 if (COMPUTE_INVERSE)
7585 {
7586 // When non-GPS measurements exist, partial derivatives will vary upon
7587 // each iteration due to changes in the latest estimates, and so
7588 // normals will be reformed. Hence, compute inverse.
7589
7591 // The procedure for constraining free coordinates causes the elements
7592 // in the normal matrix to vary greatly in magnitude. In some cases,
7593 // this opens the possibility of a loss of accuracy in the
7594 // matrix inversion process as the algorithm will be repeatedly
7595 // computing the difference between numbers of vastly different
7596 // magnitude. Inaccuracy in the inversion can be mitigated by scaling
7597 // the normal matrix before inversion and subsequently reversing the effect.
7598 //
7599
7600 // 1. Create scalar matrix
7601 matrix_2d *S = nullptr, *SN = nullptr;
7602
7603 if (projectSettings_.a.scale_normals_to_unity)
7604 {
7605 S = new matrix_2d(v_normals_.at(block).rows(), v_normals_.at(block).rows());
7606 SN = new matrix_2d(v_normals_.at(block).rows(), v_normals_.at(block).rows());
7607 for (UINT32 i(0); i<v_normals_.at(block).rows(); ++i)
7608 S->put(i, i, sqrt(v_normals_.at(block).get(i, i)));
7609 // 2. Scale Normals to reduce the diagonal elements of Normals to unity
7610 //SN->multiply(*S, v_normals_.at(block));
7611 SN->multiply(*S, "N", v_normals_.at(block), "N");
7612
7613 //v_normals_.at(block).multiply(*SN, *S);
7614 v_normals_.at(block).multiply(*SN, "N", *S, "N");
7615 }
7617
7618 // Calculate Inverse of AT * V-1 * A
7620
7621 // Check for a failed inverse solution
7622 if (boost::math::isnan(v_normals_.at(block).get(0, 0)) ||
7623 boost::math::isinf(v_normals_.at(block).get(0, 0)))
7624 {
7625 std::stringstream ss;
7626 ss << "Solve(): Invalid variance matrix:" << std::endl;
7627 ss << std::setprecision(6) << std::fixed << v_normals_.at(block);
7628 SignalExceptionAdjustment(ss.str(), 0);
7629 }
7630
7632 // 2. Compute inverse of N (via S * (SNS)-1 * S)
7633 if (projectSettings_.a.scale_normals_to_unity)
7634 {
7635 //SN->multiply(*S, v_normals_.at(block));
7636 SN->multiply(*S, "N", v_normals_.at(block), "N");
7637
7638 //v_normals_.at(block).multiply(*SN, *S);
7639 v_normals_.at(block).multiply(*SN, "N", *S, "N");
7640
7641 delete S;
7642 delete SN;
7643 }
7645 }
7646
7647 if (projectSettings_.g.verbose > 0)
7648 {
7649 debug_file << "Block " << block + 1;
7650 if (projectSettings_.a.adjust_mode != SimultaneousMode)
7651 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
7652 debug_file << std::endl;
7653 debug_file << "Precisions" << std::fixed << std::setprecision(16) << v_normals_.at(block) << std::endl;
7654 }
7655
7656 // compute weighted "measured minus computed"
7657 matrix_2d At_Vinv_m(v_design_.at(block).columns(), 1);
7658 At_Vinv_m.multiply(v_AtVinv_.at(block), "N", v_measMinusComp_.at(block), "N");
7659
7660 // Solve corrections from normal equations
7661 v_corrections_.at(block).redim(v_design_.at(block).columns(), 1);
7662 v_corrections_.at(block).multiply(v_normals_.at(block), "N", At_Vinv_m, "N");
7663
7664 if (projectSettings_.g.verbose > 0)
7665 {
7666
7667 if (projectSettings_.a.multi_thread)
7668 dbg_file_mutex.lock();
7669
7670 it_vUINT32 _it_stn;
7671 UINT32 i;
7672
7673 switch (projectSettings_.a.adjust_mode)
7674 {
7675 case Phased_Block_1Mode:
7676 case PhasedMode:
7677 for (i=0; i<v_parameterStationList_.at(block).size(); ++i)
7678 {
7679 debug_file << bstBinaryRecords_.at(v_parameterStationList_.at(block).at(i)).stationName;
7680 if ((_it_stn = find(v_ISL_.at(block).begin(), v_ISL_.at(block).end(), v_parameterStationList_.at(block).at(i))) != v_ISL_.at(block).end())
7681 debug_file << "i ";
7682 else if ((_it_stn = find(v_JSL_.at(block).begin(), v_JSL_.at(block).end(), v_parameterStationList_.at(block).at(i))) != v_JSL_.at(block).end())
7683 debug_file << "j ";
7684 else
7685 debug_file << " ";
7686 }
7687 break;
7688 case SimultaneousMode:
7689 for (i=0; i<v_ISL_.at(block).size(); ++i)
7690 debug_file << bstBinaryRecords_.at(v_ISL_.at(block).at(i)).stationName << " ";
7691 break;
7692 }
7693
7694 debug_file << std::endl;
7695 debug_file << "Block " << block + 1;
7696 if (projectSettings_.a.adjust_mode != SimultaneousMode)
7697 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
7698 debug_file << std::endl;
7699 debug_file << "Weighted measurements" << std::fixed << std::setprecision(16) << At_Vinv_m << std::endl;
7700
7701 debug_file << "Block " << block + 1;
7702 if (projectSettings_.a.adjust_mode != SimultaneousMode)
7703 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
7704 debug_file << std::endl;
7705 debug_file << "Corrections" << std::fixed << std::setprecision(16) << v_corrections_.at(block) << std::endl;
7706 debug_file.flush();
7707
7708 if (projectSettings_.a.multi_thread)
7709 dbg_file_mutex.unlock();
7710
7711 }
7712}
void put(const index_t &r, const index_t &c, const double &val)
void FormInverseVarianceMatrix(matrix_2d *vmat, bool LOWER_IS_CLEARED=false)
boost::mutex dbg_file_mutex
Definition dnaadjust.cpp:43

References bstBinaryRecords_, dynadjust::networkadjust::dbg_file_mutex, debug_file, debug_SolutionInformation(), FormInverseVarianceMatrix(), forward_, dynadjust::math::matrix_2d::multiply(), Phased_Block_1Mode, PhasedMode, projectSettings_, dynadjust::math::matrix_2d::put(), SignalExceptionAdjustment(), SimultaneousMode, v_AtVinv_, v_corrections_, v_design_, v_ISL_, v_JSL_, v_measMinusComp_, v_normals_, and v_parameterStationList_.

Referenced by SolveTry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SolveMT()

void dynadjust::networkadjust::dna_adjust::SolveMT ( bool COMPUTE_INVERSE,
const UINT32 & block )

Definition at line 299 of file dnaadjust-multi.cpp.

300{
301 if (COMPUTE_INVERSE)
302 {
303 // Compute inverse of normals (aposteriori variance matrix)
304 // (AT * V-1 * A)-1
306 }
307
308 // compute weighted "measured minus computed"
309 matrix_2d At_Vinv_m(v_designR_.at(block).columns(), 1);
310 At_Vinv_m.multiply(v_AtVinvR_.at(block), "N", v_measMinusCompR_.at(block), "N");
311
312 // Solve corrections from normal equations
313 v_correctionsR_.at(block).redim(v_designR_.at(block).columns(), 1);
314 v_correctionsR_.at(block).multiply(v_normalsR_.at(block), "N", At_Vinv_m, "N");
315
316 // debug output?
317 if (projectSettings_.g.verbose > 3)
318 {
319 dbg_file_mutex.lock();
320
321 UINT32 i;
322 switch (projectSettings_.a.adjust_mode)
323 {
324 case PhasedMode:
325 for (i=0; i<v_parameterStationList_.at(block).size(); ++i)
326 {
327 debug_file << bstBinaryRecords_.at(v_parameterStationList_.at(block).at(i)).stationName;
328 if (find(v_ISL_.at(block).begin(), v_ISL_.at(block).end(), v_parameterStationList_.at(block).at(i)) != v_ISL_.at(block).end())
329 debug_file << "i ";
330 else if (find(v_JSL_.at(block).begin(), v_JSL_.at(block).end(), v_parameterStationList_.at(block).at(i)) != v_JSL_.at(block).end())
331 debug_file << "j ";
332 else
333 debug_file << " ";
334 }
335 break;
336 }
337
338 debug_file << std::endl;
339
340 debug_file << "Block " << block + 1 << " (Reverse)";
341 debug_file << std::endl;
342 debug_file << "Pre-adjustment Estimates" << std::fixed << std::setprecision(16) << v_estimatedStationsR_.at(block);
343 debug_file << "Block " << block + 1 << " (Reverse)";
344 debug_file << std::endl;
345 debug_file << "Design" << std::fixed << std::setprecision(16) << v_designR_.at(block);
346 debug_file << "Block " << block + 1 << " (Reverse)";
347 debug_file << std::endl;
348 debug_file << "Measurements" << std::fixed << std::setprecision(16) << v_measMinusCompR_.at(block);
349 debug_file << "Block " << block + 1 << " (Reverse)";
350 debug_file << std::endl;
351 debug_file << "At * V-inv" << std::fixed << std::setprecision(16) << v_AtVinvR_.at(block) << std::endl;
352 debug_file << "Block " << block + 1 << " (Reverse)";
353 debug_file << std::endl;
354 debug_file << "Normals " << std::fixed << std::setprecision(16) << v_normalsR_.at(block) << std::endl;
355 debug_file << "Block " << block + 1 << " (Reverse)";
356 debug_file << std::endl;
357 debug_file << "Precisions" << std::fixed << std::setprecision(16) << v_normalsR_.at(block) << std::endl;
358 debug_file << "Block " << block + 1 << " (Reverse)";
359 debug_file << std::endl;
360 debug_file << "Corrections" << std::fixed << std::setprecision(16) << v_correctionsR_.at(block) << std::endl;
361 debug_file.flush();
362
363 dbg_file_mutex.unlock();
364
365 }
366}

References bstBinaryRecords_, dynadjust::networkadjust::dbg_file_mutex, debug_file, FormInverseVarianceMatrix(), dynadjust::math::matrix_2d::multiply(), PhasedMode, projectSettings_, v_AtVinvR_, v_correctionsR_, v_designR_, v_estimatedStationsR_, v_ISL_, v_JSL_, v_measMinusCompR_, v_normalsR_, and v_parameterStationList_.

Referenced by SolveMTTry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CombineRequired()

bool dynadjust::networkadjust::dna_adjust::CombineRequired ( const UINT32 & block) const
inline

Definition at line 410 of file dnaadjust.hpp.

410 {
411 if (v_blockMeta_.at(block)._blockLast)
412 return false;
413 if (v_blockMeta_.at(block)._blockIsolated)
414 return false;
415 if (v_blockMeta_.at(block)._blockFirst)
416 return false;
417 return true;
418 }

References v_blockMeta_.

Referenced by BackupNormals(), and PrepareAdjustmentCombine().

Here is the caller graph for this function:

◆ InitialiseandValidateMsrPointer()

bool dynadjust::networkadjust::dna_adjust::InitialiseandValidateMsrPointer ( const it_vUINT32 & _it_block_msr,
it_vmsr_t & _it_msr )
private

Definition at line 8761 of file dnaadjust.cpp.

8762{
8763 _it_msr = bmsBinaryRecords_.begin() + (*_it_block_msr);
8764
8765 // Is this measurement ignored?
8766 if (_it_msr->ignore)
8767 return true;
8768
8769 // Only pointers to the starting element of each measurement are kept.
8770 // Hence, Y and Z and variance-covariance components are regarded as
8771 // non-measurement elements. When one of these is found,
8772 // continue to next element. See declaration of measRecord.measStart
8773 // for more info.
8774 if (_it_msr->measStart != xMeas)
8775 return true;
8776
8777 return false;
8778}
@ xMeas
Definition dnatypes.hpp:404

References bmsBinaryRecords_, and xMeas.

Referenced by ComputeChiSquare(), ComputeGlobalPelzer(), ComputePrecisionAdjMsrs(), FillDesignNormalMeasurementsMatrices(), PrintCompMeasurements(), UpdateMsrRecords(), UpdateMsrTstatistic(), and UpdateNormals().

Here is the caller graph for this function:

◆ InitialiseMeasurement()

bool dynadjust::networkadjust::dna_adjust::InitialiseMeasurement ( pit_vmsr_t _it_msr,
bool buildnewMatrices )
private

Definition at line 4849 of file dnaadjust.cpp.

4850{
4851 if (buildnewMatrices)
4852 {
4853 // Was this measurement reduced from previous
4854 // adjustment, which was serialised to disk?
4855 if (bms_meta_.reduced)
4856 // Restore measured value
4857 (*_it_msr)->term1 = (*_it_msr)->preAdjMeas;
4858 else
4859 // This is the first time adjust has run, so
4860 // back up the raw measurement
4861 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
4862
4863 if (projectSettings_.a.stage)
4864 return true;
4865 }
4866
4867 return false;
4868}

References bms_meta_, and projectSettings_.

Referenced by UpdateDesignNormalMeasMatrices_A(), UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_C(), UpdateDesignNormalMeasMatrices_E(), UpdateDesignNormalMeasMatrices_H(), UpdateDesignNormalMeasMatrices_I(), UpdateDesignNormalMeasMatrices_J(), UpdateDesignNormalMeasMatrices_L(), UpdateDesignNormalMeasMatrices_M(), UpdateDesignNormalMeasMatrices_P(), UpdateDesignNormalMeasMatrices_Q(), UpdateDesignNormalMeasMatrices_R(), UpdateDesignNormalMeasMatrices_V(), and UpdateDesignNormalMeasMatrices_Z().

Here is the caller graph for this function:

◆ RebuildNormals()

void dynadjust::networkadjust::dna_adjust::RebuildNormals ( const UINT32 block,
adjustOperation direction,
bool AddConstraintStationstoNormals,
bool BackupNormals )
private

Definition at line 3691 of file dnaadjust.cpp.

3692{
3693 // Update measurements-computed vector using new estimates
3694 FillDesignNormalMeasurementsMatrices(false, block, false);
3695
3696 // Update normal equations and add parameter station variances
3697 v_normals_.at(block).zero();
3698 UpdateNormals(block, false);
3699
3700 if (!AddConstraintStationstoNormals)
3701 return;
3702
3703 // Add parameter stations
3704 switch (direction)
3705 {
3706 case __forward__:
3707
3708 // Back up normals. This copy contains the contributions from all
3709 // apriori measurement variances, excluding parameter station
3710 // variances and junction station variances
3711 if (BackupNormals)
3712 v_normalsR_.at(block) = v_normals_.at(block);
3713
3715 break;
3716
3717 case __reverse__:
3719 break;
3720 default:
3721 break;
3722 }
3723}
void BackupNormals(const UINT32 block, bool MT_ReverseOrCombine)
void FillDesignNormalMeasurementsMatrices(bool buildnewMatrices, const UINT32 &block, bool MT_ReverseOrCombine)
void UpdateNormals(const UINT32 &block, bool MT_ReverseOrCombine)

References __forward__, __reverse__, AddConstraintStationstoNormalsForward(), AddConstraintStationstoNormalsReverse(), BackupNormals(), FillDesignNormalMeasurementsMatrices(), UpdateNormals(), v_normals_, and v_normalsR_.

Referenced by AdjustPhasedForward(), CarryForwardJunctions(), and CarryReverseJunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateAdjustment()

void dynadjust::networkadjust::dna_adjust::UpdateAdjustment ( bool iterate)
private

Definition at line 475 of file dnaadjust.cpp.

476{
477 isPreparing_ = true;
478
479 UINT32 block;
480
481 bool lastBlock, updateGeographicCoordinates;
482
483 try {
484
485 // Prepare initial matrices for least squares adjustment
486 for (block=0; block<blockCount_; ++block)
487 {
488 if (IsCancelled())
489 break;
490
491 switch (projectSettings_.a.adjust_mode)
492 {
493 case PhasedMode:
495
496 lastBlock = v_blockMeta_.at(block)._blockLast;
497 updateGeographicCoordinates =
498 v_msrTally_.at(block).ContainsNonGPS() || // if this block contains measurements in the local reference frame, or
499 lastBlock || // if this is the last block, or
500 !iterate; // if no further iterations are required
501
502 if (updateGeographicCoordinates || lastBlock)
503 // For staged adjustments, load block info
504 if (projectSettings_.a.stage)
506
507 // The last block in the forward pass is rigorous. However, the coordinates were not updated
508 // since both phased and multi thread adjustments require original coordinates for the reverse
509 // pass, both of which take place after the forward pass has completed.
510 if (lastBlock)
511 {
512 // For staged adjustments, load block info
513 if (projectSettings_.a.stage)
517
518 v_estimatedStations_.at(block) = v_rigorousStations_.at(block);
519 v_originalStations_.at(block) = v_rigorousStations_.at(block);
520 v_normals_.at(block) = v_rigorousVariances_.at(block);
521
522 if (projectSettings_.a.stage)
525 }
526
527 // Update geographic coordinates if:
528 // - The network contains non-GPS measurements, so that partial
529 // derivatives can be correctly formed
530 // - This is the last block in a contiguous network
531 // - There are no more iterations required
532 if (updateGeographicCoordinates)
534
535 if (projectSettings_.a.stage)
536 {
537 // For staged adjustments, unload all matrix data
538 UnloadBlock(block);
539 continue;
540 }
541
542 break;
543 case SimultaneousMode:
544 // Update geographic coordinates
545 if (v_msrTally_.at(block).ContainsNonGPS() || // if this block contains measurements in the local reference frame, or
546 !iterate) // if no further iterations are required
548 break;
549 }
550
551 // Update measurements-computed vector using new estimates
552 FillDesignNormalMeasurementsMatrices(false, block, false);
553
554 // If no further iterations are required, then don't update the normals.
555 // This is because the inverse of the normals is needed for computing
556 // precision of adjusted measurements, whereas UpdateNormals() only
557 // produces normals prior to inversion.
558 // Hence, only design and msr-comp are required so as to compute stats
559 if (!iterate)
560 continue;
561
562 switch (projectSettings_.a.adjust_mode)
563 {
564 case PhasedMode:
566 v_normals_.at(block).zero();
567 UpdateNormals(block, false);
568
569 if (projectSettings_.a.multi_thread)
570 {
571 v_estimatedStationsR_.at(block) = v_rigorousStations_.at(block);
572
573 // Update measurements-computed vector for reverse thread using new estimates
574 FillDesignNormalMeasurementsMatrices(false, block, true);
575 }
576
577 // Back up normals. This copy contains the contributions from all
578 // apriori measurement variances, excluding parameter station
579 // variances and junction station variances
580 v_normalsR_.at(block) = v_normals_.at(block);
582
583 break;
584 case SimultaneousMode:
585 if (v_msrTally_.at(0).ContainsNonGPS())
586 {
587 // update normals
588 v_normals_.at(0).zero();
589 UpdateNormals(0, false);
591 }
592 break;
593 }
594 }
595 }
596 catch (const NetMemoryException& e) {
597 std::stringstream ss;
598 double memory;
599 try { GetMemoryFootprint(memory, GIGABYTE_SIZE); }
600 catch (...) {}
601
602 ss << "UpdateAdjustment(): Process terminated while allocating memory for the " << std::endl << " adjustment matrices. " <<
603 "Details: " << std::endl << " " << e.what() << std::endl;
604 ss << " The memory footprint consumed by " << __BINARY_NAME__ << " is " <<
605 std::fixed << std::setprecision(2) << memory << " GB" << std::endl;
606 adj_file << "- Error:" << std::endl << " " << ss.str();
607 SignalExceptionAdjustment(ss.str(), block);
608 }
609 catch (const std::runtime_error& e) {
610 std::stringstream ss;
611 ss << "UpdateAdjustment(): Process terminated while updating the " << std::endl << " adjustment matrices. " <<
612 "Details: " << std::endl << " " << e.what() << std::endl;
613 adj_file << "- Error:" << std::endl << " " << ss.str();
614 SignalExceptionAdjustment(ss.str(), block);
615 }
616
617 isPreparing_ = false;
618}
void UpdateGeographicCoordsPhased(const UINT32 &block, matrix_2d *estimatedStations)
@ sf_normals
Definition dnatypes.hpp:449
@ sf_estimated_stns
Definition dnatypes.hpp:454

References AddConstraintStationstoNormalsForward(), AddConstraintStationstoNormalsSimultaneous(), adj_file, blockCount_, DeserialiseBlockFromMappedFile(), FillDesignNormalMeasurementsMatrices(), GetMemoryFootprint(), GIGABYTE_SIZE, IsCancelled(), isPreparing_, Phased_Block_1Mode, PhasedMode, projectSettings_, SerialiseBlockToMappedFile(), sf_estimated_stns, sf_normals, sf_original_stns, sf_rigorous_stns, sf_rigorous_vars, SignalExceptionAdjustment(), SimultaneousMode, UnloadBlock(), UpdateGeographicCoords(), UpdateGeographicCoordsPhased(), UpdateNormals(), v_blockMeta_, v_estimatedStations_, v_estimatedStationsR_, v_msrTally_, v_normals_, v_normalsR_, v_originalStations_, v_rigorousStations_, v_rigorousVariances_, and dynadjust::exception::NetMemoryException::what().

Referenced by AdjustPhased(), AdjustPhasedMultiThread(), AdjustSimultaneous(), and GenerateStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ValidateandFinaliseAdjustment()

void dynadjust::networkadjust::dna_adjust::ValidateandFinaliseAdjustment ( boost::timer::cpu_timer & tot_time)
private

Definition at line 3452 of file dnaadjust.cpp.

3453{
3454 isAdjusting_ = false;
3455
3457 return;
3458
3459 if (IsCancelled())
3460 {
3462 return;
3463 }
3464
3465 if (CurrentIteration() == projectSettings_.a.max_iterations &&
3466 fabs(maxCorr_) > projectSettings_.a.iteration_threshold)
3468
3469 // Back up simultaneous rigorous variance estimates (for serialising
3470 // to disk at SerialiseAdjustedVarianceMatrices() ), so that executing adjust
3471 // in report-results mode has access to the latest variance estimates
3472 switch (projectSettings_.a.adjust_mode)
3473 {
3474 case SimultaneousMode:
3475 v_rigorousVariances_.at(0) = v_normals_.at(0);
3476 break;
3477 case Phased_Block_1Mode:
3478 case PhasedMode:
3479 default:
3480 break;
3481 }
3482
3483 // Print status
3485 // Compute and print time taken to run adjustment
3487}
void PrintAdjustmentTime(boost::timer::cpu_timer &time, _TIMER_TYPE_)
@ ADJUST_MAX_ITERATIONS_EXCEEDED
@ ADJUST_CANCELLED
@ total_time
Definition dnatypes.hpp:341

References ADJUST_CANCELLED, ADJUST_MAX_ITERATIONS_EXCEEDED, ADJUST_TEST_FAILED, adjustStatus_, CurrentIteration(), isAdjusting_, IsCancelled(), maxCorr_, Phased_Block_1Mode, PhasedMode, PrintAdjustmentStatus(), PrintAdjustmentTime(), projectSettings_, SimultaneousMode, total_time, v_normals_, and v_rigorousVariances_.

Referenced by AdjustPhased(), AdjustPhasedBlock1(), and AdjustSimultaneous().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjustmentStatus()

void dynadjust::networkadjust::dna_adjust::PrintAdjustmentStatus ( )
private

Definition at line 3490 of file dnaadjust.cpp.

3491{
3492 // print adjustment status
3493 adj_file << std::endl << OUTPUTLINE << std::endl;
3494 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "SOLUTION";
3495
3496 if (projectSettings_.a.report_mode)
3497 {
3498 adj_file << "Printing results of last adjustment only" << std::endl;
3499 return;
3500 }
3501
3502 switch (projectSettings_.a.adjust_mode)
3503 {
3504 case Phased_Block_1Mode:
3506 adj_file << "Estimates solved for Block 1 only" << std::endl;
3507 else
3508 adj_file << "Failed to solve Block 1 estimates" << std::endl;
3509 break;
3510 default:
3511 if (adjustStatus_ == ADJUST_SUCCESS &&
3512 CurrentIteration() <= projectSettings_.a.max_iterations &&
3513 fabs(maxCorr_) <= projectSettings_.a.iteration_threshold)
3514 adj_file << "Converged" << std::endl;
3515 else
3516 adj_file << "Failed to converge" << std::endl;
3517 }
3518}

References adj_file, ADJUST_SUCCESS, adjustStatus_, CurrentIteration(), maxCorr_, OUTPUTLINE, Phased_Block_1Mode, PRINT_VAR_PAD(), and projectSettings_.

Referenced by AdjustPhasedMultiThread(), and ValidateandFinaliseAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjustmentTime()

void dynadjust::networkadjust::dna_adjust::PrintAdjustmentTime ( boost::timer::cpu_timer & time,
_TIMER_TYPE_ timerType )
private

Definition at line 3521 of file dnaadjust.cpp.

3522{
3523 // calculate and print total time
3524 boost::posix_time::milliseconds ms(boost::posix_time::milliseconds(time.elapsed().wall/MILLI_TO_NANO));
3525 boost::posix_time::time_duration t(ms);
3526
3527 std::stringstream ss;
3528 if (t > boost::posix_time::seconds(1))
3529 ss << boost::posix_time::seconds(static_cast<long>(t.total_seconds()));
3530 else
3531 ss << t;
3532
3533 if (timerType == iteration_time)
3534 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Elapsed time" << ss.str() << std::endl;
3535 else
3536 {
3537 total_time_ = ms;
3538 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Total time" << ss.str() << std::endl << std::endl;
3539 }
3540}
const long MILLI_TO_NANO(1000000)
@ iteration_time
Definition dnatypes.hpp:340
::xsd::cxx::parser::time time

References adj_file, iteration_time, MILLI_TO_NANO(), PRINT_VAR_PAD(), and total_time_.

Referenced by AdjustPhased(), AdjustPhasedBlock1(), AdjustPhasedMultiThread(), AdjustSimultaneous(), and ValidateandFinaliseAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintIteration()

void dynadjust::networkadjust::dna_adjust::PrintIteration ( const UINT32 & iteration)
private

Definition at line 3543 of file dnaadjust.cpp.

3544{
3545 std::stringstream iterationMessage;
3546
3547 iterationMessage << std::endl << OUTPUTLINE << std::endl <<
3548 std::setw(PRINT_VAR_PAD) << std::left << "ITERATION" << iteration << std::endl << std::endl;
3549
3550 adj_file << iterationMessage.str();
3551
3552 if (projectSettings_.g.verbose)
3553 debug_file << iterationMessage.str();
3554}

References adj_file, debug_file, OUTPUTLINE, PRINT_VAR_PAD(), and projectSettings_.

Referenced by AdjustPhased(), AdjustPhasedMultiThread(), and AdjustSimultaneous().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitialiseAdjustment()

void dynadjust::networkadjust::dna_adjust::InitialiseAdjustment ( )
private

Definition at line 193 of file dnaadjust.cpp.

194{
195 adj_file << std::endl << "+ Initialising adjustment" << std::endl;
196
197 // Confidence interval
198 double conf(projectSettings_.a.confidence_interval * 0.01);
199 boost::math::normal dist(0.0, 1.0);
200 conf += (1.0 - conf) / 2.0;
201 criticalValue_ = boost::math::quantile(dist, conf);
202
204
205 blockCount_ = 1;
207
209 statusMessages_.clear();
210 currentBlock_ = 0;
212
213 bstBinaryRecords_.clear();
214 bmsBinaryRecords_.clear();
215
216 // output precision helpers
217 PRECISION_SEC_STN = projectSettings_.o._precision_seconds_stn;
218 PRECISION_MTR_STN = projectSettings_.o._precision_metres_stn;
219 PRECISION_SEC_MSR = projectSettings_.o._precision_seconds_msr;
220 PRECISION_MTR_MSR = projectSettings_.o._precision_metres_msr;
221
222 // constraint values
223 // cartesian reference frame
224 _var_C = projectSettings_.a.fixed_std_dev * projectSettings_.a.fixed_std_dev; // metres
225 _var_F = projectSettings_.a.free_std_dev * projectSettings_.a.free_std_dev; // metres
226
227 // form inverse of variance for fixed stations
228 _inv_var_cart_c.redim(3, 3);
229 _inv_var_cart_c.put(0, 0, 1./_var_C);
230 _inv_var_cart_c.put(1, 1, 1./_var_C);
231 _inv_var_cart_c.put(2, 2, 1./_var_C);
232
233 // form inverse of variance for free stations
234 _inv_var_cart_f.redim(3, 3);
235 _inv_var_cart_f.put(0, 0, 1./_var_F);
236 _inv_var_cart_f.put(1, 1, 1./_var_F);
237 _inv_var_cart_f.put(2, 2, 1./_var_F);
238
239}
void initialiseIteration(const UINT32 &iteration=0)

References _inv_var_cart_c, _inv_var_cart_f, _var_C, _var_F, adj_file, ADJUST_SUCCESS, adjustStatus_, blockCount_, bmsBinaryRecords_, bstBinaryRecords_, criticalValue_, currentBlock_, initialiseIteration(), potentialOutlierCount_, PRECISION_MTR_MSR, PRECISION_MTR_STN, PRECISION_SEC_MSR, PRECISION_SEC_STN, projectSettings_, statusMessages_, and v_blockStationsMap_.

Referenced by PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDefaultReferenceFrame()

void dynadjust::networkadjust::dna_adjust::SetDefaultReferenceFrame ( )
private

Definition at line 14040 of file dnaadjust.cpp.

14041{
14042 // Capture the datum recorded within binary file meta.
14043 // Note: One of two applications will have been the last to update the
14044 // reference frame in the bst/bms_meta and in every station record:
14045 // 1. dnaimport
14046 // 2. dnareftran
14047 //
14048 // * When dnaimport runs, the default reference frame and its epoch is
14049 // set within within the bst/bms_meta, which may or may not be set by
14050 // the user, and is intended to be used to define the datum (ellipsoid
14051 // and epochal coordinate set) to be used throughout all computations.
14052 // * For input files which do not specify datum, the datum in bst/bms_meta
14053 // will be the same as datum defined for all stations and measurement
14054 // records. For input files which do specify a datum for each station
14055 // and measurement, the datum in the bst/bms_meta may be different to what
14056 // is set for each station and measurement. In either case, dnaadjust
14057 // takes what is set in the bst/bms_meta. The user is responsible for
14058 // knowing the data and its reference frame.
14059 // * If dnareftran has been run, every station and measurement record will
14060 // have been transformed to the one frame and epoch. These reference frame
14061 // records will be consistent with the bst/bms_meta.
14062 // * If the user has not specified an epoch with WGS84, then the epoch will
14063 // be set to "time immemorial" being 01.01.1900. Any occurrence of this will
14064 // cause output to be set to an empty string ("").
14065 try {
14066 // Load binary stations data. Throws runtime_error on failure.
14067 dna_io_bst bst;
14069 datum_.SetDatumFromEpsg(bst_meta_.epsgCode, bst_meta_.epoch);
14070 }
14071 catch (const std::runtime_error& e) {
14072 SignalExceptionAdjustment(e.what(), 0);
14073 }
14074}
void load_bst_file_meta(const std::string &bst_filename, binary_file_meta_t &bst_meta)
Definition dnaiobst.cpp:67

References bst_meta_, datum_, dynadjust::iostreams::dna_io_bst::load_bst_file_meta(), projectSettings_, and SignalExceptionAdjustment().

Referenced by PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadNetworkFiles()

void dynadjust::networkadjust::dna_adjust::LoadNetworkFiles ( )
private

Definition at line 14076 of file dnaadjust.cpp.

14077{
14078 adj_file << "+ Loading network files" << std::endl;
14079
14080 try {
14081 // Load binary stations data. Throws runtime_error on failure.
14082 dna_io_bst bst;
14084 }
14085 catch (const std::runtime_error& e) {
14086 SignalExceptionAdjustment(e.what(), 0);
14087 }
14088
14089 // Initialise values.
14090 // Note: The premise underlying the way various programs treat heights is as follows:
14091 // - import reads in all heights, but, due to the absence of an attribute or element in
14092 // the DynaML schema that states the whether the height system is orthometric or
14093 // ellipsoidal, the height system is unknown.
14094 // - geoid populates the geoid separation and deflections. It is only when the user
14095 // supplies the convert-stn-hts option that it is assumed all heights are orthometric, in
14096 // which case the heights are converted to ellipsoidal.
14097 // - adjust does not alter station heights, and so adjust assumes currentHeight and
14098 // initialHeight are ellipsoid heights. Of course, H measurements are converted to R
14099 // measurements. If geoid is not run and the user has supplied
14100 // orthometric heights, the adjustment will not produce realistic results.
14101 // If a the wrong system (or height) is supplied, one of two things, depending on
14102 // the height constraint flag, occur. For instance, if an orthometric height is supplied,
14103 // and geoid information is not available, and the station is Free in the height component,
14104 // the error will simply result in a large station height correction. If the wrong height
14105 // is supplied and the station is constrained, then erroneous values will result.
14106 // - It is the user's responsibility to ensure the right heights, geoid values and constraints
14107 // are supplied.
14108
14109 // Take any additional user-supplied constraints (CCC,CCF,etc) and
14110 // apply to binary station records
14112
14113 vUINT32 v_ISLTemp;
14114 try {
14115 // open the asl file. the asl file is required to ensure invalid stations are
14116 // excluded from the adjustment. invalid stations are those with no measurements.
14117 dna_io_asl asl;
14118 asl_count_ = asl.load_asl_file(projectSettings_.s.asl_file, &vAssocStnList_, &v_ISLTemp);
14119 }
14120 catch (const std::runtime_error& e) {
14121 SignalExceptionAdjustment(e.what(), 0);
14122 }
14123
14124 // remove stations from the stations list that are invalid and update 'true' station count
14125 RemoveInvalidISLStations(v_ISLTemp);
14126
14127 unknownParams_ = unknownsCount_ = static_cast<UINT32>(v_ISLTemp.size() * 3);
14128 UINT32 i;
14129
14130 // Copy to v_ISL for simultaneous adjustments
14131 // For phased adjustments, v_ISL will be populated by LoadSegmentationFile()
14132 if (projectSettings_.a.adjust_mode == SimultaneousMode)
14133 {
14134 // only copy to v_ISL in simultaneous mode
14135 v_ISL_.push_back(v_ISLTemp);
14136
14137 v_unknownsCount_.clear();
14139
14140 // check memory availability for block station map
14141 if (v_blockStationsMap_.at(0).max_size() <= v_ISL_.at(0).size())
14142 {
14143 std::stringstream ss;
14144 ss << "LoadNetworkFiles(): Could not allocate sufficient memory for blockStationsMap." << std::endl;
14145 SignalExceptionAdjustment(ss.str(), 0);
14146 }
14147
14148 // fill block station map, and create pseudo measurement list
14149 for (i=0; i<v_ISL_.at(0).size(); ++i)
14150 v_blockStationsMap_.at(0)[v_ISL_.at(0).at(i)] = i;
14151 }
14152
14153 try {
14154 // Load binary measurements data. Throws runtime_error on failure.
14155 dna_io_bms bms;
14157 }
14158 catch (const std::runtime_error& e) {
14159 SignalExceptionAdjustment(e.what(), 0);
14160 }
14161
14162 UINT32 m(0), clusterID(0);
14163 it_vmsr_t _it_msr;
14164
14165 UINT16 axis(0);
14166
14167 // Consider the following sequence of program calls:
14168 // > import -n unisqr1 uni_sqrstn.xml uni_sqrmsr.xml
14169 // > adjust unisqr1
14170 // > geoid -g ausgeoid09.gsb unisqr1 --convert
14171 // > adjust unisqr1 --output-adj-msr
14172 //
14173 // For some reason, these adjustment results don't agree exactly with
14174 // results from the following:
14175 // > import -n unisqr uni_sqrstn.xml uni_sqrmsr.xml
14176 // > geoid -g ausgeoid09.gsb unisqr --convert
14177 // > adjust unisqr --output-adj-msr
14178 //
14179 // Tests on uni_sqrstn.xml and uni_sqrmsr.xml result in the following differences:
14180 //
14181 // dX | dY | dZ
14182 // ---------+---------+--------
14183 // 0 | 0.0003 | 0
14184 // -0.0006 | 0 |-0.0006
14185 //
14186 // Not much of a difference, but different.
14187 //
14188 // Adjustments agree perfectly for GPS-only networks, which indicates that the problem is
14189 // most likely to do with the application of deflections of the vertical
14190
14191
14192 switch (projectSettings_.a.adjust_mode)
14193 {
14194 case SimultaneousMode:
14195 v_CML_.clear();
14196 v_CML_.push_back(vUINT32(bmsr_count_));
14197
14198 v_measurementCount_.clear();
14199 v_measurementCount_.push_back(0);
14200
14202 v_measurementVarianceCount_.push_back(0);
14203
14204 // Create measurement tally to determine the measurement
14205 // types that have been supplied
14206 for (_it_msr=bmsBinaryRecords_.begin(), i=0, m=0;
14207 _it_msr!=bmsBinaryRecords_.end();
14208 ++_it_msr, ++i)
14209 {
14210
14211 // Don't include ignored measurements in the CML or
14212 // in the measurement count. Ignored measurements are still
14213 // kept in bmsBinaryRecords_, but not in
14214 // the list of measurements (i.e. CML) for this adjustment
14215 if (_it_msr->ignore)
14216 continue;
14217
14218 // Don't include covariance terms in the CML or
14219 // in the measurement count
14220 if (_it_msr->measStart > zMeas)
14221 continue;
14222
14223 switch (_it_msr->measType)
14224 {
14225 case 'Y':
14226 case 'X':
14227 // Is this an xMeas on a new cluster?
14228 if (clusterID != _it_msr->clusterID)
14229 {
14230 // Yes, so capture the fist xMeas only
14231 v_CML_.at(0).at(m++) = i;
14232 clusterID = _it_msr->clusterID;
14233 }
14234
14235 break;
14236 default:
14237 v_CML_.at(0).at(m++) = i;
14238 }
14239
14240 if (_it_msr->measType == 'D')
14241 {
14242 // The first direction holds number of target directions plus RO. But
14243 // since it is possible for target directions to be ignored, take
14244 // the number of non-ignored measurements (vectorCount2)
14245 // Since directions are reduced to angles, subtract one.
14246 // Target directions are assigned zero vectorCount1
14247 if (_it_msr->vectorCount2 > 0)
14248 {
14249 v_measurementCount_.at(0) += _it_msr->vectorCount2 - 1;
14250
14251 // The following is needed if the upper triangular variance matrix
14252 // for each direction set measurement (as required for propagating)
14253 v_measurementVarianceCount_.at(0) += _it_msr->vectorCount2 - 1;
14254 }
14255 continue;
14256 }
14257
14258 switch (_it_msr->measType)
14259 {
14260 case 'G':
14261 case 'X':
14262 case 'Y':
14263 // add the
14264 v_measurementCount_.at(0)++;
14265
14266 // The following is needed if the upper triangular variance matrix
14267 // for each GNSS measurement (as is required for propagating)
14268 v_measurementVarianceCount_.at(0) += 1 + axis++;
14269
14270 if (axis > 2)
14271 axis = 0;
14272
14273 continue;
14274 }
14275
14276 // add the measurement!
14277 v_measurementCount_.at(0)++;
14278
14279 // The following is needed if the upper triangular variance matrix
14280 // for each GNSS measurement (as is required for propagating)
14282 }
14283
14284 if (m == 0)
14285 {
14286 std::stringstream ss;
14287 ss << "No measurements were found." << std::endl <<
14288 " If measurements were successfully loaded on import, ensure that\n all measurements have not been ignored." << std::endl;
14289 SignalExceptionAdjustment(ss.str(), 0);
14290 }
14291
14292 // resize to cater for measurements which were ignored
14293 if (m != i)
14294 v_CML_.at(0).resize(m);
14295
14296 // strip all but the start measurements
14298
14300 }
14301
14303}
UINT32 load_asl_file(const std::string &asl_filename, vASL *vbinary_asl, vUINT32 *vfree_stn)
Definition dnaioasl.cpp:33
UINT32 load_bms_file(const std::string &bms_filename, pvmsr_t vbinary_msr, binary_file_meta_t &bms_meta)
Definition dnaiobms.cpp:110
UINT32 load_bst_file(const std::string &bst_filename, pvstn_t vbinary_stn, binary_file_meta_t &bst_meta)
Definition dnaiobst.cpp:111
void RemoveInvalidISLStations(vUINT32 &v_ISLTemp)
void RemoveNonMeasurements(const UINT32 &block)
unsigned short UINT16
Definition dnatypes.hpp:52
@ zMeas
Definition dnatypes.hpp:406

References adj_file, ApplyAdditionalConstraints(), asl_count_, bms_meta_, bmsBinaryRecords_, bmsr_count_, bst_meta_, bstBinaryRecords_, bstn_count_, dynadjust::iostreams::dna_io_asl::load_asl_file(), dynadjust::iostreams::dna_io_bms::load_bms_file(), dynadjust::iostreams::dna_io_bst::load_bst_file(), measurementCount_, measurementParams_, projectSettings_, RemoveInvalidISLStations(), RemoveNonMeasurements(), SignalExceptionAdjustment(), SimultaneousMode, unknownParams_, unknownsCount_, v_blockStationsMap_, v_CML_, v_ISL_, v_measurementCount_, v_measurementParams_, v_measurementVarianceCount_, v_unknownsCount_, vAssocStnList_, and zMeas.

Referenced by PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateMsrToStnTally()

void dynadjust::networkadjust::dna_adjust::CreateMsrToStnTally ( )
private

Definition at line 3259 of file dnaadjust.cpp.

3260{
3261 // 1. Load the aml file. The aml file is needed to determine the measurements
3262 // connected to each station.
3263 try {
3264 // Load aml file. Throws runtime_error on failure.
3265 dna_io_aml aml;
3267 }
3268 catch (const std::runtime_error& e) {
3269 SignalExceptionAdjustment(e.what(), 0);
3270 }
3271
3272 v_stnmsrTally_.clear();
3273 v_stnmsrTally_.resize(vAssocStnList_.size());
3274
3275 _it_vasl _it_asl;
3276 UINT32 i, m, amlIndex, msrCount;
3277
3278 for (_it_asl=vAssocStnList_.begin(), i=0; _it_asl!=vAssocStnList_.end(); ++_it_asl, ++i)
3279 {
3280 msrCount = _it_asl->GetAssocMsrCount();
3281
3282 for (m=0; m<msrCount; ++m)
3283 {
3284 amlIndex = _it_asl->GetAMLStnIndex() + m;
3285
3286 if (bmsBinaryRecords_.at(vAssocMsrList_.at(amlIndex).bmsr_index).ignore)
3287 continue;
3288
3289 v_stnmsrTally_.at(i).IncrementMsrType(bmsBinaryRecords_.at(vAssocMsrList_.at(amlIndex).bmsr_index).measType);
3290 }
3291
3292 v_stnmsrTally_.at(i).TotalCount();
3293 }
3294}
void load_aml_file(const std::string &aml_filename, v_aml_pair *vbinary_aml, pvmsr_t bmsRecords)
Definition dnaioaml.cpp:30
vASL::iterator _it_vasl

References bmsBinaryRecords_, dynadjust::iostreams::dna_io_aml::load_aml_file(), projectSettings_, SignalExceptionAdjustment(), v_stnmsrTally_, vAssocMsrList_, and vAssocStnList_.

Referenced by PrintMeasurementsToStation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AdjustSimultaneous()

void dynadjust::networkadjust::dna_adjust::AdjustSimultaneous ( )
private

Definition at line 3362 of file dnaadjust.cpp.

3363{
3366
3367 std::ostringstream ss;
3368 std::string corr_msg;
3369 boost::posix_time::milliseconds elapsed_time(boost::posix_time::milliseconds(0));
3370 boost::timer::cpu_timer it_time, tot_time;
3371
3372 bool iterate;
3373
3374 for (UINT32 i=0; i<projectSettings_.a.max_iterations; ++i)
3375 {
3376 if (IsCancelled())
3377 break;
3378
3379 isIterationComplete_ = false;
3380
3381 blockLargeCorr_ = 0;
3382 largestCorr_ = 0.0;
3383
3384 // Print the iteration # to adj file
3386
3387 // Does the user want to print computed measurements on each iteration?
3388 if (projectSettings_.o._cmp_msr_iteration)
3389 PrintCompMeasurements(0, "a-priori");
3390
3391 ss.str("");
3392
3393 it_time.start();
3394
3395 // Least Squares Solution
3396 // Inverse is only required if:
3397 // - This is the first iteration
3398 // - The network contains non-GPS measurements, in which an updated
3399 // normals matrix would be available based upon reformed partial
3400 // derivatives in the design matrix
3401 SolveTry(CurrentIteration() < 2 || v_msrTally_.at(0).ContainsNonGPS());
3402
3403 // calculate and print total time
3405
3406 // Add corrections to estimates
3407 v_estimatedStations_.at(0).add(v_corrections_.at(0));
3408
3409 // Compute and print largest correction
3410 maxCorr_ = v_corrections_.at(0).compute_maximum_value();
3411 OutputLargestCorrection(corr_msg);
3412
3413 // update data for messages
3414 iterationCorrections_.add_message(corr_msg);
3415 iterationQueue_.push_and_notify(CurrentIteration()); // currentIteration begins at 1, so not zero-indexed
3416 isIterationComplete_ = true;
3417
3418 // continue iterating?
3419 iterate = !IsCancelled() && fabs(maxCorr_) > projectSettings_.a.iteration_threshold;
3420 if (!iterate)
3421 break;
3422
3423 // Does the user want to print statistics on each iteration?
3424 if (projectSettings_.o._adj_stat_iteration)
3425 {
3426 // Compute network statistics
3428
3429 // Print statistics summary to adj file
3430 PrintStatistics(false);
3431 }
3432
3433 // Does the user want to print adjusted measurements
3434 // on each iteration?
3435 if (projectSettings_.o._adj_msr_iteration)
3437
3438 // Does the user want to print adjusted station coordinates
3439 // on each iteration?
3440 if (projectSettings_.o._adj_stn_iteration)
3441 // computes geographic coordinates if required
3443 false, !v_msrTally_.at(0).ContainsNonGPS(), !v_msrTally_.at(0).ContainsNonGPS(), true, false);
3444
3445 // Update normals and measured-computed matrices for the next iteration.
3446 UpdateAdjustment(iterate);
3447 }
3448
3450}
void SolveTry(bool COMPUTE_INVERSE, const UINT32 &block=0)
void OutputLargestCorrection(std::string &formatted_msg)
void ValidateandFinaliseAdjustment(boost::timer::cpu_timer &tot_time)
void PrintCompMeasurements(const UINT32 &block, const std::string &msg="")
void PrintIteration(const UINT32 &iteration)

References adj_file, ADJUST_SUCCESS, adjustStatus_, blockLargeCorr_, ComputeandPrintAdjMsrOnIteration(), ComputeStatisticsOnIteration(), CurrentIteration(), incrementIteration(), initialiseIteration(), IsCancelled(), isIterationComplete_, iteration_time, iterationCorrections_, iterationQueue_, largestCorr_, maxCorr_, OutputLargestCorrection(), PrintAdjStations(), PrintAdjustmentTime(), PrintCompMeasurements(), PrintIteration(), PrintStatistics(), projectSettings_, SolveTry(), UpdateAdjustment(), v_corrections_, v_estimatedStations_, v_msrTally_, v_normals_, and ValidateandFinaliseAdjustment().

Referenced by AdjustNetwork().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AdjustPhased()

void dynadjust::networkadjust::dna_adjust::AdjustPhased ( )
private

Definition at line 3557 of file dnaadjust.cpp.

3558{
3560
3561 std::string corr_msg;
3562 std::ostringstream ss;
3563 UINT32 i;
3564 bool iterate(true);
3565
3566 boost::timer::cpu_timer it_time, tot_time;
3567
3568 // do until convergence criteria is met
3569 for (i=0; i<projectSettings_.a.max_iterations; ++i)
3570 {
3571 if (IsCancelled())
3572 break;
3573
3574 isIterationComplete_ = false;
3575
3576 blockLargeCorr_ = 0;
3577 largestCorr_ = 0.0;
3578 maxCorr_ = 0.0;
3579
3580 // initialise potential outlier count and statistical
3581 // quantities
3583 chiSquaredStage_ = 0.;
3585
3586 // Print the iteration # to adj file
3588
3589 it_time.start();
3590
3592 if (IsCancelled())
3593 break;
3594
3596 if (IsCancelled())
3597 break;
3598
3599 // calculate and print total time
3601
3602 // Calculate and print largest adjustment correction and station ID
3603 OutputLargestCorrection(corr_msg);
3604
3605 iterationCorrections_.add_message(corr_msg);
3606 iterationQueue_.push_and_notify(CurrentIteration()); // currentIteration begins at 1, so not zero-indexed
3607 isIterationComplete_ = true;
3608
3609 // Continue iterating?
3610 iterate = !IsCancelled() && fabs(maxCorr_) > projectSettings_.a.iteration_threshold;
3611 if (!iterate)
3612 break;
3613
3614 // Update normals and measured-computed matrices for the next iteration.
3615 // Similar to PrepareAdjustment, UpdateAdjustment prepares every block
3616 // in the network so that forward and reverse adjustments can commence
3617 // at the same time.
3618 UpdateAdjustment(iterate);
3619 if (IsCancelled())
3620 break;
3621
3622 // Does the user want to print statistics on each iteration?
3623 if (projectSettings_.o._adj_stat_iteration)
3624 {
3625 // Compute network statistics
3627
3628 // Print statistics summary to adj file
3629 PrintStatistics(false);
3630 }
3631
3632 // Does the user want to print adjusted measurements
3633 // on each iteration?
3634 if (projectSettings_.o._adj_msr_iteration)
3636 }
3637
3639
3641}

References AdjustPhasedForward(), AdjustPhasedReverseCombine(), blockLargeCorr_, chiSquared_, chiSquaredStage_, ComputeandPrintAdjMsrOnIteration(), ComputeStatisticsOnIteration(), CurrentIteration(), incrementIteration(), initialiseIteration(), IsCancelled(), isIterationComplete_, iteration_time, iterationCorrections_, iterationQueue_, largestCorr_, maxCorr_, measurementParams_, OutputLargestCorrection(), potentialOutlierCount_, PrintAdjustmentTime(), PrintIteration(), PrintStatistics(), projectSettings_, UpdateAdjustment(), and ValidateandFinaliseAdjustment().

Referenced by AdjustNetwork().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AdjustPhasedForward()

void dynadjust::networkadjust::dna_adjust::AdjustPhasedForward ( )
private

Definition at line 3726 of file dnaadjust.cpp.

3727{
3728 forward_ = true;
3729
3730 UINT32 currentBlock(0);
3731
3732 // For staged adjustments, load the first block from mapped memory file
3733 if (projectSettings_.a.stage)
3734 {
3735 DeserialiseBlockFromMappedFile(currentBlock);
3736 RebuildNormals(currentBlock, __forward__, true, true);
3737 if (IsCancelled())
3738 return;
3739 }
3740
3741 _it_uint32_u32u32_pair begin, end;
3742 begin = v_msr_block_.begin();
3743
3744 for (currentBlock=0; currentBlock<blockCount_; ++currentBlock)
3745 {
3746 if (IsCancelled())
3747 break;
3748
3749 SetcurrentBlock(currentBlock);
3750
3751 // Does the user want to print computed measurements?
3752 if (projectSettings_.o._cmp_msr_iteration)
3753 PrintCompMeasurements(currentBlock, "a-priori");
3754
3755 if (projectSettings_.o._adj_stn_iteration || projectSettings_.o._cmp_msr_iteration)
3756 {
3757 adj_file_mutex.lock();
3758 adj_file << std::endl << std::left << "Adjusting ";
3759 if (v_blockMeta_.at(currentBlock)._blockIsolated)
3760 adj_file << "(isolated) ";
3761 adj_file << "block " << currentBlock+1;
3762 if (v_blockMeta_.at(currentBlock)._blockLast || v_blockMeta_.at(currentBlock)._blockIsolated)
3763 adj_file << " (forward, rigorous)... ";
3764 else
3765 adj_file << " (forward, in isolation)... ";
3766 adj_file_mutex.unlock();
3767 }
3768
3769 // At this point, whether first iteration or not, if currentBlock is the first block,
3770 // the normals will have been initialised. For all later blocks, the normals will contain
3771 // the contribution of junction station coordinates and variances from preceding blocks.
3772 // In either case, the block is ready for adjustment. Junction station coordinates and
3773 // variances are carried forward below
3774
3775 // Least Squares Solution
3776 SolveTry(true, currentBlock);
3777
3778 // Does the user want to print adjusted measurements
3779 // on each iteration?
3780 if (projectSettings_.o._adj_msr_iteration ||
3781 projectSettings_.o._adj_stn_iteration ||
3782 projectSettings_.o._cmp_msr_iteration)
3783 adj_file << " done." << std::endl;
3784
3785 // Add corrections to estimates and update degrees of freedom.
3786 UpdateEstimatesForward(currentBlock);
3787
3788 // Compute and print adjusted measurements for this
3789 // block during an iteration
3790 if (projectSettings_.o._adj_msr_iteration)
3791 {
3792 end = begin + v_CML_.at(currentBlock).size();
3793 ComputeandPrintAdjMsrBlockOnIteration(currentBlock, v_uint32_u32u32_pair(begin, end), true);
3794 begin = end;
3795 }
3796
3797 // Debug and diagnose (if required)
3798 debug_BlockInformation(currentBlock, (forward_ ? " (Forward)" : " (Reverse)"));
3799
3800 // OK, now shrink matrices back to normal size
3801 ShrinkForwardMatrices(currentBlock);
3802
3803 // Carry the estimated junction station coordinates and variances
3804 // to the next block for applicable blocks only. For staged
3805 // Deserialise the next block from mapped files and rebuild
3806 // normals
3807 CarryForwardJunctions(currentBlock, currentBlock+1);
3808
3809 // For staged adjustments, write to disk and unload matrix data
3810 if (projectSettings_.a.stage)
3811 // Don't offload last block since the reverse adjustment
3812 // will need this block
3813 if (currentBlock < (blockCount_ - 1))
3814 OffloadBlockToMappedFile(currentBlock);
3815 }
3816}
void UpdateEstimatesForward(const UINT32 block)
void ShrinkForwardMatrices(const UINT32 currentBlock)
void debug_BlockInformation(const UINT32 &currentBlock, const std::string &adjustment_method)
void ComputeandPrintAdjMsrBlockOnIteration(const UINT32 &block, v_uint32_u32u32_pair msr_block, bool printHeader)
void CarryForwardJunctions(const UINT32 currentBlock, const UINT32 nextBlock)

References __forward__, adj_file, dynadjust::networkadjust::adj_file_mutex, blockCount_, CarryForwardJunctions(), ComputeandPrintAdjMsrBlockOnIteration(), debug_BlockInformation(), DeserialiseBlockFromMappedFile(), forward_, IsCancelled(), OffloadBlockToMappedFile(), PrintCompMeasurements(), projectSettings_, RebuildNormals(), SetcurrentBlock(), ShrinkForwardMatrices(), SolveTry(), UpdateEstimatesForward(), v_blockMeta_, v_CML_, and v_msr_block_.

Referenced by AdjustPhased().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AdjustPhasedReverseCombine()

void dynadjust::networkadjust::dna_adjust::AdjustPhasedReverseCombine ( )
private

Definition at line 4412 of file dnaadjust.cpp.

4413{
4414 forward_ = false;
4415 isCombining_ = false;
4416 UINT32 currentBlock(blockCount_ - 1);
4417 UINT32 pseudomsrJSLCount(0);
4418
4419 for (UINT32 block=0; block<blockCount_; ++block, --currentBlock)
4420 {
4421 if (IsCancelled())
4422 break;
4423
4424 SetcurrentBlock(currentBlock);
4425
4426 // If currentBlock is a single block, then there is no need to perform a
4427 // reverse adjustment (i.e. continue);
4428 // Otherwise, if currentBlock is the last block, then this is the
4429 // commencement of a reverse run. In this case, recompute meas-minus-comp,
4430 // update normals
4431 if (!PrepareAdjustmentReverse(currentBlock, false))
4432 continue;
4433
4434 if (projectSettings_.o._adj_stn_iteration)
4435 {
4436 adj_file << std::endl << std::left << "Adjusting block " << currentBlock+1;
4437 if (!v_blockMeta_.at(currentBlock)._blockFirst)
4438 adj_file << " (reverse, in isolation)... ";
4439 else
4440 // all single blocks and first block of a contiguous list
4441 adj_file << " (reverse, rigorous)... ";
4442 }
4443
4444 // At this point, whether first iteration or not, if currentBlock is the last block,
4445 // the normals will have been initialised. For all subsequent blocks, the normals will contain
4446 // the contribution of junction station coordinates and variances from preceding blocks.
4447 // In either case, the block is ready for adjustment. Junction station coordinates and
4448 // variances are carried in the reverse direction below
4449
4450 if (projectSettings_.g.verbose > 3)
4451 debug_file << "In isolation" << std::endl;
4452
4453 // Backup normals prior to inversion for re-use in combination
4454 // adjustment... only if a combination is required
4455 BackupNormals(currentBlock, false);
4456
4457 // Least Squares Solution
4458 SolveTry(true, currentBlock);
4459
4460 if (projectSettings_.o._adj_stn_iteration)
4461 adj_file << " done." << std::endl;
4462
4463 // Add corrections to estimates.
4464 // If --output-adj-iter-stat argument is supplied or currentBlock
4465 // is the first block, then compute geographic coordinates, recompute
4466 // meas-minus-computed vector, then print statistics.
4467 // Output of stats also prints largest correction.
4468 // If --output-adj-iter-stn argument is supplied, print station coords
4469 UpdateEstimatesReverse(currentBlock, false);
4470
4471 // Debug and diagnose (if required)
4472 debug_BlockInformation(currentBlock, "(reverse, in isolation)");
4473
4474 // Carry the estimated junction station coordinates and variances to the next block and
4475 // combine. CarryReverseEstimates will return false if currentBlock is the first block
4476 // or an isolated block. If estimates can be carried, CarryReverseEstimates updates
4477 // geographic coords (if req'd), recomputes meas-minus-comp vector and updates normals for
4478 // the next block.
4479 if (CarryReverseJunctions(currentBlock, currentBlock-1, false))
4480 {
4482 // Combination Adjustment
4483 //
4484 // Perform combination on all blocks except the first and last as they will
4485 // be rigorous from reverse and forward adjustments respectively
4486 //
4487 // First, carry the junction station estimates and variances of the next block
4488 // (obtained during the forward pass). These were copied to v_junctionEstimatesFwd_
4489 // and v_junctionVariances_ in CarryStnEstimatesandVariancesForward(..) during
4490 // the forward pass.
4491 if (PrepareAdjustmentCombine(currentBlock, pseudomsrJSLCount, false))
4492 {
4493 isCombining_ = true;
4494 if (projectSettings_.g.verbose > 3)
4495 debug_file << "Rigorous" << std::endl;
4496
4497 if (projectSettings_.o._adj_stn_iteration)
4498 if (!v_blockMeta_.at(currentBlock)._blockFirst)
4499 adj_file << std::endl << std::left << "Adjusting block " << currentBlock+1 << " (reverse, rigorous)... ";
4500
4501 // Least Squares Solution
4502 SolveTry(true, currentBlock);
4503
4504 if (projectSettings_.o._adj_stn_iteration)
4505 adj_file << " done." << std::endl;
4506
4507 // shrink msr-comp and AtVinv by pseudomsrJSLCount from forward pass
4508 UpdateEstimatesCombine(currentBlock, pseudomsrJSLCount);
4509
4510 // Debug and diagnose (if required)
4511 debug_BlockInformation(currentBlock, "(reverse, rigorous)");
4512
4513 isCombining_ = false;
4514
4515 } // if (PrepareAdjustmentCombine(currentBlock, pseudomsrJSLCount, false)) ... combination adjustment
4516
4517 // shrink msr-comp and AtVinv by JSL count from reverse pass
4518
4519 } // if (CarryReverseJunctions(currentBlock, currentBlock-1, false))
4520
4521 if (projectSettings_.a.stage)
4522 {
4523 ComputeAdjMsrBlockOnIteration(currentBlock);
4525 measurementParams_ += v_measurementParams_.at(currentBlock);
4526 }
4527
4528 // Update the rigorous coordinates
4529 UpdateEstimatesFinal(currentBlock);
4530
4531 // For staged adjustments, write to disk and unload matrix data
4532 if (projectSettings_.a.stage)
4533 OffloadBlockToMappedFile(currentBlock);
4534
4535 } // for (UINT32 block=0; block<blockCount_; ++block, --currentBlock)
4536}
void ComputeAdjMsrBlockOnIteration(const UINT32 &block)
void UpdateEstimatesReverse(const UINT32 block, bool MT_ReverseOrCombine)
void UpdateEstimatesCombine(const UINT32 block, UINT32 prevJSLCount)
bool PrepareAdjustmentReverse(const UINT32 block, bool MT_ReverseOrCombine)
bool CarryReverseJunctions(const UINT32 currentBlock, const UINT32 nextBlock, bool MT_ReverseOrCombine)
bool PrepareAdjustmentCombine(const UINT32 block, UINT32 &pseudomsrJSLCount, bool MT_ReverseOrCombine)

References adj_file, BackupNormals(), blockCount_, CarryReverseJunctions(), chiSquared_, chiSquaredStage_, ComputeAdjMsrBlockOnIteration(), debug_BlockInformation(), debug_file, forward_, IsCancelled(), isCombining_, measurementParams_, OffloadBlockToMappedFile(), PrepareAdjustmentCombine(), PrepareAdjustmentReverse(), projectSettings_, SetcurrentBlock(), SolveTry(), UpdateEstimatesCombine(), UpdateEstimatesFinal(), UpdateEstimatesReverse(), v_blockMeta_, and v_measurementParams_.

Referenced by AdjustPhased().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CombinationThreadRequired()

bool dynadjust::networkadjust::dna_adjust::CombinationThreadRequired ( )
private

Definition at line 254 of file dnaadjust-multi.cpp.

255{
256 for (UINT32 block(0); block<blockCount_; ++block)
257 {
258 // Combination adjustment is required if there
259 // is at least one intermediate block.
260 if (v_blockMeta_.at(block)._blockIntermediate)
261 return true;
262 }
263 return false;
264}

References blockCount_, and v_blockMeta_.

Referenced by AdjustPhasedMultiThread().

Here is the caller graph for this function:

◆ AdjustPhasedMultiThread()

void dynadjust::networkadjust::dna_adjust::AdjustPhasedMultiThread ( )
private

Definition at line 93 of file dnaadjust-multi.cpp.

94{
96
97 std::string corr_msg;
98 std::ostringstream ss;
99 UINT32 i;
100 bool iterate(true);
101
102 boost::posix_time::milliseconds iteration_time(boost::posix_time::milliseconds(0));
103 boost::timer::cpu_timer it_time, tot_time;
104
105#if defined(__ICC) || defined(__INTEL_COMPILER) // Intel compiler
106 boost::shared_ptr<thread> f, r, c;
107 std::vector< boost::shared_ptr<thread> > mt_adjust_threads_sp;
108#else
109 std::vector<boost::thread> mt_adjust_threads;
110#endif
111
113
114 // do until convergence criteria is met
115 for (i=0; i<projectSettings_.a.max_iterations; ++i)
116 {
117 if (IsCancelled())
118 break;
119
121 blockLargeCorr_ = 0;
122 largestCorr_ = 0.0;
123 maxCorr_ = 0.0;
124
126 // Print the iteration # to adj file.
127 // protected write to adj file (not needed here since write to
128 // adj file at this stage is via single thread
131
132 concurrentAdjustments.reset_adjustment_runs();
133 concurrentAdjustments.combine_run_stopped();
134
136
137 // Forward and reverse threads sequentially adjust all blocks in
138 // forward and reverse directions.
139#if defined(__ICC) || defined(__INTEL_COMPILER) // Intel compiler
140 f.reset(new thread(adjust_forward_thread(this, boost::ref(fwd_error))));
141 mt_adjust_threads_sp.push_back(f);
142 r.reset(new thread(adjust_reverse_thread(this, boost::ref(rev_error))));
143 mt_adjust_threads_sp.push_back(r);
144#else
145 mt_adjust_threads.push_back(boost::thread(adjust_forward_thread(this, boost::ref(fwd_error))));
146 mt_adjust_threads.push_back(boost::thread(adjust_reverse_thread(this, boost::ref(rev_error))));
147#endif
148
149 // Combination thread fires up as many threads as there are cores
150 // on the current PC to concurrently combine blocks
151#if defined(__ICC) || defined(__INTEL_COMPILER) // Intel compiler
153 {
154 c.reset(new thread(adjust_combine_thread(this, boost::ref(cmb_error))));
155 mt_adjust_threads_sp.push_back(c);
156 }
157#else
159 mt_adjust_threads.push_back(boost::thread(adjust_combine_thread(this, boost::ref(cmb_error))));
160#endif
161
162 // Start the clock
163 it_time.start();
164
165 // Start the forward, reverse and combine threads, which commences the
166 // network adjustment
167#if defined(__ICC) || defined(__INTEL_COMPILER) // Intel compiler
168 for_each(mt_adjust_threads_sp.begin(), mt_adjust_threads_sp.end(), boost::mem_fn(&thread::join));
169#else
170 for_each(mt_adjust_threads.begin(), mt_adjust_threads.end(), boost::mem_fn(&boost::thread::join));
171#endif
172 // This point is reached when the threads have finished
173 iteration_time = boost::posix_time::milliseconds(it_time.elapsed().wall/MILLI_TO_NANO);
174
175 //delete mt_adjust_threads;
176#if defined(__ICC) || defined(__INTEL_COMPILER) // Intel compiler
177 mt_adjust_threads_sp.clear();
178#else
179 mt_adjust_threads.clear();
180#endif
181
182 concurrentAdjustments.combine_run_stopped();
183
184 // Were any exceptions thrown? If so, re-throw and let
185 // test stub handle the exception
186 if (fwd_error)
187 // exception thrown in the forward pass
188 boost::rethrow_exception(fwd_error);
189 else if (rev_error)
190 // exception thrown in the reverse pass
191 boost::rethrow_exception(rev_error);
192 else if (cmb_error)
193 // exception thrown in one of the combination adjustments
194 boost::rethrow_exception(cmb_error);
195
196 if (IsCancelled())
197 break;
198
199 ss.str("");
200 if (iteration_time > boost::posix_time::seconds(1))
201 ss << boost::posix_time::seconds(static_cast<long>(iteration_time.total_seconds()));
202 else
203 ss << iteration_time;
204
206 // protected write to adj file (not needed here since write to
207 // adj file at this stage is via single thread
208 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Elapsed time" << ss.str() << std::endl;
209 OutputLargestCorrection(corr_msg);
211
212 if (projectSettings_.g.verbose)
213 debug_file << concurrentAdjustments.print_adjusted_blocks();
214
215 iterationCorrections_.add_message(corr_msg);
216 iterationQueue_.push_and_notify(CurrentIteration()); // currentIteration begins at 1, so not zero-indexed
217
218 // continue iterating?
219 iterate = fabs(maxCorr_) > projectSettings_.a.iteration_threshold;
220
221 // Update normals and measured-computed matrices for the next iteration.
222 // Similar to PrepareAdjustment, UpdateAdjustment prepares every block
223 // in the network so that forward and reverse adjustments can commence
224 // at the same time.
225 UpdateAdjustment(iterate);
226
227 if (!iterate)
228 break;
229 }
230
231 isAdjusting_ = false;
232
234 return;
235
236 // This is similar to the check in ValidateandFinaliseAdjustment API for
237 // phased single-thread mode.
238 if (IsCancelled())
239 {
241 return;
242 }
243
244 if (CurrentIteration() == projectSettings_.a.max_iterations)
246
247 // Print status
249 // Compute and print time taken to run adjustment
251}
concurrent_block_adjustment< UINT32 > concurrentAdjustments
concurrent_queue< UINT32 > combineAdjustmentQueue
Definition dnaadjust.cpp:46
boost::exception_ptr fwd_error
Definition dnaadjust.cpp:48
boost::exception_ptr rev_error
Definition dnaadjust.cpp:48
boost::exception_ptr cmb_error
Definition dnaadjust.cpp:48

References adj_file, ADJUST_CANCELLED, ADJUST_MAX_ITERATIONS_EXCEEDED, ADJUST_TEST_FAILED, adjustStatus_, blockCount_, blockLargeCorr_, dynadjust::networkadjust::cmb_error, CombinationThreadRequired(), dynadjust::networkadjust::combineAdjustmentQueue, dynadjust::networkadjust::concurrentAdjustments, CurrentIteration(), debug_file, dynadjust::networkadjust::fwd_error, incrementIteration(), initialiseIteration(), isAdjusting_, IsCancelled(), iteration_time, iterationCorrections_, iterationQueue_, largestCorr_, maxCorr_, MILLI_TO_NANO(), OutputLargestCorrection(), PRINT_VAR_PAD(), PrintAdjustmentStatus(), PrintAdjustmentTime(), PrintIteration(), projectSettings_, dynadjust::networkadjust::rev_error, SetcurrentBlock(), total_time, and UpdateAdjustment().

Referenced by AdjustNetwork().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AdjustPhasedBlock1()

void dynadjust::networkadjust::dna_adjust::AdjustPhasedBlock1 ( )
private

Definition at line 3646 of file dnaadjust.cpp.

3647{
3649
3650 std::ostringstream ss;
3651 std::string corr_msg;
3652
3654
3655 maxCorr_ = 0.0;
3656 blockLargeCorr_ = 0;
3657 largestCorr_ = 0.0;
3658
3659 adj_file << std::endl << std::endl;
3660
3661 if (projectSettings_.g.verbose)
3662 debug_file << std::endl << std::endl;
3663
3664 boost::timer::cpu_timer it_time, tot_time;
3665
3666 // Only the reverse adjustment is needed to achieve rigorous
3667 // estimates for block 1
3669
3670 blockLargeCorr_ = 0;
3671 largestCorr_ = v_corrections_.at(0).maxvalue();
3672
3673 // calculate and print total time
3675
3676 // Compute and print largest correction for block 1 only
3677 maxCorr_ = v_corrections_.at(0).compute_maximum_value();
3678 OutputLargestCorrection(corr_msg);
3679
3680 if (fabs(maxCorr_) > projectSettings_.a.iteration_threshold)
3682
3683 iterationCorrections_.add_message(corr_msg);
3684 iterationQueue_.push_and_notify(CurrentIteration()); // currentIteration begins at 1, so not zero-indexed
3685
3687}
@ ADJUST_THRESHOLD_EXCEEDED

References adj_file, ADJUST_SUCCESS, ADJUST_THRESHOLD_EXCEEDED, AdjustPhasedReverse(), adjustStatus_, blockLargeCorr_, CurrentIteration(), debug_file, initialiseIteration(), iteration_time, iterationCorrections_, iterationQueue_, largestCorr_, maxCorr_, OutputLargestCorrection(), PrintAdjustmentTime(), projectSettings_, v_corrections_, and ValidateandFinaliseAdjustment().

Referenced by AdjustNetwork().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AdjustPhasedReverse()

void dynadjust::networkadjust::dna_adjust::AdjustPhasedReverse ( )
private

Definition at line 4540 of file dnaadjust.cpp.

4541{
4542 forward_ = false;
4543 isCombining_ = false;
4544 UINT32 currentBlock(blockCount_ - 1);
4545
4546 // For staged adjustments, load the last block from mapped memory file
4547 if (projectSettings_.a.stage)
4548 DeserialiseBlockFromMappedFile(currentBlock);
4549
4550 for (UINT32 block=0; block<blockCount_; ++block, --currentBlock)
4551 {
4552 if (IsCancelled())
4553 break;
4554
4555 SetcurrentBlock(currentBlock);
4556
4557 // If currentBlock is a single block, then there is no need to perform a
4558 // reverse adjustment (i.e. continue);
4559 // Otherwise, if currentBlock is the last block, then this is the
4560 // commencement of a reverse run. In this case, recompute meas-minus-comp,
4561 // update normals
4562 if (!PrepareAdjustmentReverse(currentBlock, false))
4563 continue;
4564
4565 if (projectSettings_.o._adj_stn_iteration)
4566 {
4567 adj_file << std::endl << std::left << "Adjusting block " << currentBlock+1;
4568 if (!v_blockMeta_.at(currentBlock)._blockFirst)
4569 adj_file << " (reverse, in isolation)... ";
4570 else
4571 // all single blocks and first block of a contiguous list
4572 adj_file << " (reverse, rigorous)... ";
4573 }
4574
4575 // At this point, whether first iteration or not, if currentBlock is the last block,
4576 // the normals will have been initialised. For all subsequent blocks, the normals will contain
4577 // the contribution of junction station coordinates and variances from preceding blocks.
4578 // In either case, the block is ready for adjustment. Junction station coordinates and
4579 // variances are carried in the reverse direction below
4580
4581 if (projectSettings_.g.verbose > 3)
4582 debug_file << "In isolation" << std::endl;
4583
4584 // Least Squares Solution
4585 SolveTry(true, currentBlock);
4586
4587 if (projectSettings_.o._adj_stn_iteration)
4588 adj_file << " done." << std::endl;
4589
4590 // Add corrections to estimates.
4591 // If --output-adj-iter-stat argument is supplied or currentBlock
4592 // is the first block, then compute geographic coordinates, recompute
4593 // meas-minus-computed vector, then print statistics.
4594 // Output of stats also prints largest correction.
4595 // If --output-adj-iter-stn argument is supplied, print station coords
4596 UpdateEstimatesReverse(currentBlock, false);
4597
4598 // Debug (if required)
4599 debug_BlockInformation(currentBlock, "(reverse, in isolation)");
4600
4601 // Carry the estimated junction station coordinates and variances to the next block and
4602 // combine. CarryReverseEstimates will return false if currentBlock is the first block
4603 // or an isolated block. If estimates can be carried, CarryReverseEstimates updates
4604 // geographic coords (if req'd), recomputes meas-minus-comp vector and updates normals for
4605 // the next block.
4606 CarryReverseJunctions(currentBlock, currentBlock-1, false);
4607
4608 // Update the rigorous coordinates
4609 UpdateEstimatesFinal(currentBlock);
4610
4611 // For staged adjustments, write to disk and unload matrix data
4612 if (projectSettings_.a.stage)
4613 OffloadBlockToMappedFile(currentBlock);
4614
4615 } // for (UINT32 block=0; block<blockCount_; ++block, --currentBlock)
4616}

References adj_file, blockCount_, CarryReverseJunctions(), debug_BlockInformation(), debug_file, DeserialiseBlockFromMappedFile(), forward_, IsCancelled(), isCombining_, OffloadBlockToMappedFile(), PrepareAdjustmentReverse(), projectSettings_, SetcurrentBlock(), SolveTry(), UpdateEstimatesFinal(), UpdateEstimatesReverse(), and v_blockMeta_.

Referenced by AdjustPhasedBlock1().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ApplyAdditionalConstraints()

void dynadjust::networkadjust::dna_adjust::ApplyAdditionalConstraints ( )
private

Definition at line 14439 of file dnaadjust.cpp.

14440{
14441 if (projectSettings_.a.station_constraints.empty())
14442 return;
14443
14444 // load station map
14445 v_string_uint32_pair vStnsMap;
14446 if (projectSettings_.a.map_file.empty())
14447 projectSettings_.a.map_file = projectSettings_.g.input_folder + FOLDER_SLASH + projectSettings_.g.network_name + ".map";
14448 LoadStationMap(&vStnsMap, projectSettings_.a.map_file);
14449
14450 std::string constraint;
14451 vstring constraintStns;
14452 _it_vstr const_it;
14453
14454 try {
14455 // Extract constraints from comma delimited string
14457 projectSettings_.a.station_constraints, // the comma delimited string
14458 std::string(","), // the delimiter
14459 &constraintStns); // the respective values
14460 }
14461 catch (...) {
14462 return;
14463 }
14464
14465 if (projectSettings_.i.apply_discontinuities)
14466 {
14467 // Test for whether stations have been renamed, in which case, the
14468 // look for non empty values in stn.stationNameOrig
14469 AddDiscontinuitySites(constraintStns);
14470 }
14471
14472 it_pair_string_vUINT32 it_stnmap_range;
14473
14474 for (const_it=constraintStns.begin(); const_it!=constraintStns.end(); ++const_it)
14475 {
14476 // find this station in the station map
14477 it_stnmap_range = equal_range(vStnsMap.begin(), vStnsMap.end(), (*const_it), StationNameIDCompareName());
14478 if (it_stnmap_range.first == it_stnmap_range.second)
14479 {
14480 if (projectSettings_.i.apply_discontinuities)
14481 {
14482 // It is likely that these stations were renamed during
14483 // discontinuity processing, so continue
14484 if (++const_it == constraintStns.end())
14485 break;
14486 continue;
14487 }
14488
14489 std::stringstream ss;
14490 ss << "The supplied constraint station " << (*const_it) << " is not in the stations map. Please ensure that " <<
14491 (*const_it) << " is included in the list of stations." << std::endl;
14492
14493 SignalExceptionAdjustment(ss.str(), 0);
14494 }
14495
14496 // get constraint
14497 if (++const_it == constraintStns.end())
14498 break;
14499
14500 constraint = *const_it;
14501 // convert to upper case
14502 str_toupper<int>(constraint);
14503
14504 if (!CDnaStation::IsValidConstraint(constraint))
14505 {
14506 std::stringstream ss;
14507 ss << "The supplied station constraint " << constraint << " is not a valid constraint." << std::endl;
14508 SignalExceptionAdjustment(ss.str(), 0);
14509 }
14510
14511 // set constraint
14512 snprintf(bstBinaryRecords_.at(it_stnmap_range.first->second).stationConst, STN_CONST_WIDTH, "%s", (constraint).c_str());
14513 }
14514}
static bool IsValidConstraint(const std::string &sConst)
void LoadStationMap(pv_string_uint32_pair stnsMap, const std::string &stnmap_file)
void AddDiscontinuitySites(vstring &constraintStns)
void str_toupper(std::string &strtext)
void SplitDelimitedString(const T &str, const T &separator, std::vector< T > *tokenList)
const UINT16 STN_CONST_WIDTH(4)
vstring::iterator _it_vstr
Definition dnatypes.hpp:87
std::vector< std::string > vstring
Definition dnatypes.hpp:86
std::pair< _it_string_uint32_pair, _it_string_uint32_pair > it_pair_string_vUINT32
Definition dnatypes.hpp:306
std::vector< string_uint32_pair > v_string_uint32_pair
Definition dnatypes.hpp:283

References AddDiscontinuitySites(), bstBinaryRecords_, dynadjust::measurements::CDnaStation::IsValidConstraint(), LoadStationMap(), projectSettings_, SignalExceptionAdjustment(), SplitDelimitedString(), STN_CONST_WIDTH(), and str_toupper().

Referenced by LoadNetworkFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddDiscontinuitySites()

void dynadjust::networkadjust::dna_adjust::AddDiscontinuitySites ( vstring & constraintStns)
private

Definition at line 14305 of file dnaadjust.cpp.

14306{
14307 // sort on original name
14308 std::sort(bstBinaryRecords_.begin(), bstBinaryRecords_.end(), CompareStnOriginalName<station_t, std::string>());
14309
14310 std::pair<it_vstn_t, it_vstn_t> it_stn_range;
14311 std::string constraint;
14312
14313 _it_vstr const_it;
14314
14315 vstring constraintDiscontStns;
14316
14317 // for every constraint (note every second value will be the constraint code)
14318 for (const_it=constraintStns.begin(); const_it!=constraintStns.end(); ++const_it)
14319 {
14320 // find this constraint station in the station map
14321 it_stn_range = equal_range(bstBinaryRecords_.begin(), bstBinaryRecords_.end(), (*const_it), CompareStnOriginalName<station_t, std::string>());
14322 if (it_stn_range.first == it_stn_range.second)
14323 {
14324 // Not in the map. Get the next one
14325 continue;
14326 }
14327
14328 // this constraint station is one of the discontinuity sites.
14329 // Add the "discontinuity name"
14330 constraintDiscontStns.push_back(it_stn_range.first->stationName);
14331 // Add the constraint
14332 if (++const_it == constraintStns.end())
14333 break;
14334 constraintDiscontStns.push_back(*const_it);
14335 }
14336
14337 // add the constraint discontinuity sites
14338 constraintStns.insert(constraintStns.end(), constraintDiscontStns.begin(), constraintDiscontStns.end());
14339
14340 // restore original sort order
14341 std::sort(bstBinaryRecords_.begin(), bstBinaryRecords_.end(), CompareStnName<station_t>());
14342}

References bstBinaryRecords_.

Referenced by ApplyAdditionalConstraints().

Here is the caller graph for this function:

◆ LoadStationMap()

void dynadjust::networkadjust::dna_adjust::LoadStationMap ( pv_string_uint32_pair stnsMap,
const std::string & stnmap_file )
private

Definition at line 14517 of file dnaadjust.cpp.

14518{
14519 try {
14520 // Load station map. Throws runtime_error on failure.
14521 dna_io_map map;
14522 map.load_map_file(stnmap_file, stnsMap);
14523 }
14524 catch (const std::runtime_error& e) {
14525 SignalExceptionAdjustment(e.what(), 0);
14526 }
14527}
void load_map_file(const std::string &map_filename, pv_string_uint32_pair stnsMap)
Definition dnaiomap.cpp:34

References dynadjust::iostreams::dna_io_map::load_map_file(), and SignalExceptionAdjustment().

Referenced by ApplyAdditionalConstraints(), and InitialiseTypeBUncertainties().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResizeMatrixVectors()

void dynadjust::networkadjust::dna_adjust::ResizeMatrixVectors ( )
private

Definition at line 14530 of file dnaadjust.cpp.

14531{
14532 adj_file << "+ Allocating memory" << std::endl;
14533
14534 switch (projectSettings_.a.adjust_mode)
14535 {
14536 case SimultaneousMode:
14539 v_parameterStationList_.at(0) = v_ISL_.at(0);
14540 break;
14541 case PhasedMode:
14542 case Phased_Block_1Mode:
14543 // Load Segmentation data. LoadPhasedBlocks() calls LoadSegmentationFile() which
14544 // and assigns blockCount_
14546
14547 v_msrTally_.resize(blockCount_);
14548
14551 v_sigmaZero_.resize(blockCount_);
14554 v_passFail_.resize(blockCount_);
14555
14557 break;
14558 default:
14559 // thrown in LoadNetworkFiles()
14560 break;
14561 }
14562
14563 v_msrTally_.resize(blockCount_);
14564
14565 v_design_.resize(blockCount_);
14567 v_AtVinv_.resize(blockCount_);
14568 v_normals_.resize(blockCount_);
14569 v_normalsR_.resize(blockCount_); // used to back up normals prior to adding parameter stations and junctions
14571
14576
14577 if (projectSettings_.a.multi_thread)
14578 v_normalsRC_.resize(blockCount_);
14579
14580 for (UINT32 block(0); block<blockCount_; ++block)
14581 {
14582 // sparse matrix
14583 v_design_.at(block).matrixType(mtx_sparse);
14584
14585 // lower triangular
14586 v_normals_.at(block).matrixType(mtx_lower);
14587 v_normalsR_.at(block).matrixType(mtx_lower);
14588 v_rigorousVariances_.at(block).matrixType(mtx_lower);
14589
14590 if (projectSettings_.a.adjust_mode == PhasedMode)
14591 {
14592 v_junctionVariances_.at(block).matrixType(mtx_lower);
14593 v_junctionVariancesFwd_.at(block).matrixType(mtx_lower);
14594 }
14595 }
14596
14597}
@ mtx_lower
Definition dnatypes.hpp:440
@ mtx_sparse
Definition dnatypes.hpp:444

References adj_file, blockCount_, LoadPhasedBlocks(), mtx_lower, mtx_sparse, Phased_Block_1Mode, PhasedMode, projectSettings_, SimultaneousMode, v_AtVinv_, v_chiSquaredLowerLimit_, v_chiSquaredUpperLimit_, v_corrections_, v_correctionsR_, v_design_, v_estimatedStations_, v_ISL_, v_junctionVariances_, v_junctionVariancesFwd_, v_measMinusComp_, v_msrTally_, v_normals_, v_normalsR_, v_normalsRC_, v_originalStations_, v_parameterStationCount_, v_parameterStationList_, v_passFail_, v_precAdjMsrsFull_, v_pseudoMeasCountFwd_, v_rigorousVariances_, v_sigmaZero_, and v_statSummary_.

Referenced by PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadPhasedBlocks()

void dynadjust::networkadjust::dna_adjust::LoadPhasedBlocks ( )
private

Definition at line 14599 of file dnaadjust.cpp.

14600{
14602
14603 if (v_ISL_.size() != v_JSL_.size())
14604 {
14605 std::stringstream ss;
14606 ss << "LoadPhasedBlocks(): An unrecoverable error was encountered when loading the phased adjustment blocks." << std::endl;
14607 SignalExceptionAdjustment(ss.str(), 0);
14608 }
14609 if (v_JSL_.size() != v_CML_.size())
14610 {
14611 std::stringstream ss;
14612 ss << "LoadPhasedBlocks(): An unrecoverable error was encountered when loading the phased adjustment blocks." << std::endl;
14613 SignalExceptionAdjustment(ss.str(), 0);
14614 }
14615
14616}

References LoadSegmentationFile(), SignalExceptionAdjustment(), v_CML_, v_ISL_, and v_JSL_.

Referenced by ResizeMatrixVectors().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSegmentationFile()

void dynadjust::networkadjust::dna_adjust::LoadSegmentationFile ( )
private

Definition at line 14837 of file dnaadjust.cpp.

14838{
14839 UINT32 blockThreshold, minInnerStns;
14840
14841 try {
14842 // Load segmentation file. Throws runtime_error on failure.
14843 dna_io_seg seg;
14844 seg.load_seg_file(projectSettings_.a.seg_file,
14845 blockCount_, blockThreshold, minInnerStns,
14847 true, &bmsBinaryRecords_,
14850 }
14851 catch (const std::runtime_error& e) {
14852 SignalExceptionAdjustment(e.what(), 0);
14853 }
14854
14855 // load segmentation metrics into appropriate vectors
14857}
void load_seg_file(const std::string &seg_filename, UINT32 &blockCount, UINT32 &blockThreshold, UINT32 &minInnerStns, vvUINT32 &v_ISL, vvUINT32 &v_JSL, vvUINT32 &v_CML, bool loadMetrics, pvmsr_t bmsBinaryRecords, pvUINT32 v_measurementCount, pvUINT32 v_unknownsCount, pvUINT32 v_ContiguousNetList, pvUINT32 v_parameterStationCount)
Definition dnaioseg.cpp:115

References blockCount_, bmsBinaryRecords_, dynadjust::iostreams::dna_io_seg::load_seg_file(), LoadSegmentationMetrics(), projectSettings_, SignalExceptionAdjustment(), v_CML_, v_ContiguousNetList_, v_ISL_, v_JSL_, v_measurementCount_, v_parameterStationCount_, and v_unknownsCount_.

Referenced by LoadPhasedBlocks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadSegmentationMetrics()

void dynadjust::networkadjust::dna_adjust::LoadSegmentationMetrics ( )
private

Definition at line 14619 of file dnaadjust.cpp.

14620{
14621 v_blockMeta_.resize(blockCount_);
14630
14632
14633 vUINT32 parameterStations;
14634 UINT32 b, netID(999999), stn, c;
14635
14636 try {
14637 // read block data
14638 for (b=0; b<blockCount_; ++b)
14639 {
14640 // set Meta
14641 // If this block has a different ID, then it must be the first.
14642 if (netID != v_ContiguousNetList_.at(b))
14643 v_blockMeta_.at(b)._blockFirst = true;
14644 else
14645 v_blockMeta_.at(b)._blockFirst = false;
14646
14647 netID = v_ContiguousNetList_.at(b);
14648
14649 // if this block's ID is different to the next, then it must be the last
14650 if (b < blockCount_ - 1)
14651 {
14652 // the reason why the code in this for loop can't be placed in the preceding loop
14653 // is because element b+1 is required
14654 if (v_ContiguousNetList_.at(b) != v_ContiguousNetList_.at(b+1))
14655 v_blockMeta_.at(b)._blockLast = true;
14656 else
14657 v_blockMeta_.at(b)._blockLast = false;
14658 }
14659 else // if (b == blockCount_ - 1) // final block in whole segmentation list?
14660 v_blockMeta_.at(b)._blockLast = true;
14661
14662 // now, test whether this block is a single block
14663 if (v_blockMeta_.at(b)._blockFirst && v_blockMeta_.at(b)._blockLast)
14664 v_blockMeta_.at(b)._blockIsolated = true;
14665 // or, test whether this block is an intermediate block
14666 else if (!v_blockMeta_.at(b)._blockFirst && !v_blockMeta_.at(b)._blockLast)
14667 v_blockMeta_.at(b)._blockIntermediate = true;
14668
14669 // add station map to enable ISL/JSL stations to be referenced according to block
14670 v_parameterStationList_.at(b) = v_ISL_.at(b);
14671 v_parameterStationList_.at(b).insert(v_parameterStationList_.at(b).end(),
14672 v_JSL_.at(b).begin(), v_JSL_.at(b).end());
14673 std::sort(v_parameterStationList_.at(b).begin(), v_parameterStationList_.at(b).end());
14674
14675 v_paramStnAppearance_.at(b).resize(v_parameterStationList_.at(b).size());
14676
14677 // Add all stations to parameterStations
14678 parameterStations.insert(parameterStations.end(), v_parameterStationList_.at(b).begin(), v_parameterStationList_.at(b).end());
14679
14680 stn = 0;
14681
14682 // check memory availability for block station map
14683 if (v_blockStationsMap_.at(b).max_size() <= v_parameterStationCount_.at(b))
14684 {
14685 std::stringstream ss;
14686 ss << "LoadSegmentationMetrics(): Could not allocate sufficient memory for blockStationsMap" << std::endl;
14687 SignalExceptionAdjustment(ss.str(), 0);
14688 }
14689
14690 // fill block station map
14691 for (c=0; c<v_parameterStationCount_.at(b); ++c)
14692 v_blockStationsMap_.at(b)[v_parameterStationList_.at(b).at(c)] = stn++;
14693 }
14694
14695 }
14696 catch (...) {
14697 std::stringstream ss;
14698 ss << "LoadSegmentationMetrics(): An error was encountered when attempting to calculate " << std::endl <<
14699 " the segmentation metrics" << std::endl;
14700 SignalExceptionAdjustment(ss.str(), 0);
14701 }
14702
14705
14706 // update v_measurementVarianceCount_ if adjusted GNSS measurement
14707 // variances are to be propagated into another system. Initially,
14708 // v_measurementVarianceCount_ is copied from v_measurementCount_
14709 // which contains a count of the rows in the design matrix. This
14710 // count represents standard deviations for non-GNSS measurements
14711 // and the diagonals of GNSS measurement variances. The
14712 // following code increments the count by 3 for GNSS measurements
14713 // so that the count represents an upper triangular matrix,
14714 // being 6 (xx, xy, xz, yy, yz, zz).
14715
14716 it_vUINT32 _it_block_msr;
14717 it_vmsr_t _it_msr;
14718
14719 for (b=0; b<blockCount_; ++b)
14720 {
14721 for (_it_block_msr=v_CML_.at(b).begin();
14722 _it_block_msr!=v_CML_.at(b).end();
14723 ++_it_block_msr)
14724 {
14725 _it_msr = bmsBinaryRecords_.begin() + (*_it_block_msr);
14726
14727 // Is this measurement ignored?
14728 if (_it_msr->ignore)
14729 continue;
14730
14731 // When a GNSS measurement is found, add three
14732 // elements for X,Y,Z covariance
14733 switch (_it_msr->measType)
14734 {
14735 case 'G':
14736 case 'X':
14737 case 'Y':
14738
14739 // Increment by 3 to take count of diagonals
14740 // to 6, representing upper triangular matrix
14741 v_measurementVarianceCount_.at(b) += _it_msr->vectorCount1 * 3;
14742
14743 //v_measurementVarianceCount_.at(b) += 3;
14744 break;
14745 default:
14746 continue;
14747 }
14748 }
14749 }
14750
14751
14752 // Remove duplicates from the parameterStations list and
14753 // compute the total unknowns for the entire network
14754 strip_duplicates(parameterStations);
14755
14756 // Update "unknowns' count for whole of adjustment
14757 for_each(parameterStations.begin(), parameterStations.end(),
14758 [this](const UINT32& stn) {
14759
14760 if (bstBinaryRecords_.at(stn).stationConst[0] == 'C')
14761 unknownParams_--;
14762
14763 if (bstBinaryRecords_.at(stn).stationConst[1] == 'C')
14764 unknownParams_--;
14765
14766 if (bstBinaryRecords_.at(stn).stationConst[2] == 'C')
14767 unknownParams_--;
14768 });
14769
14770 if (unknownParams_ == 0 && unknownsCount_ > 0)
14771 allStationsFixed_ = true;
14772
14773 try {
14774 // Create station appearance list. Throws runtime_error on failure.
14775 dna_io_seg seg;
14778 }
14779 catch (const std::runtime_error& e) {
14780 SignalExceptionAdjustment(e.what(), 0);
14781 }
14782
14783 if (projectSettings_.g.verbose > 1)
14784 {
14785 debug_file << std::endl << "Station appearance list" << std::endl;
14786
14787 it_vUINT32_const _it_const;
14788 it_vstn_appear _it_appear;
14789
14790 for (UINT32 block(0); block!=blockCount_; ++block)
14791 {
14792 debug_file << "Block " << block << std::endl;
14793 debug_file << std::setw(HEADER_20) << "Station" << std::setw(HEADER_20) << "Forward" << std::setw(HEADER_20) << "Reverse" << std::setw(HEADER_20) << " " << std::endl;
14794
14795 for (_it_const=v_parameterStationList_.at(block).begin(),
14796 _it_appear=v_paramStnAppearance_.at(block).begin();
14797 _it_appear!=v_paramStnAppearance_.at(block).end();
14798 ++_it_const, ++_it_appear)
14799 {
14800 // station id
14801 debug_file << std::setw(HEADER_20) << *_it_const;
14802 // forward
14803 if (_it_appear->first_appearance_fwd)
14804 debug_file << std::setw(HEADER_20) << "true";
14805 else
14806 debug_file << std::setw(HEADER_20) << "false";
14807 // reverse
14808 if (_it_appear->first_appearance_rev)
14809 debug_file << std::setw(HEADER_20) << "true" << std::endl;
14810 else
14811 debug_file << std::setw(HEADER_20) << "false" << std::endl;
14812 }
14813 debug_file << std::endl;
14814 }
14815
14816 debug_file << std::endl;
14817 }
14818
14819}
void create_stn_appearance_list(vv_stn_appear &v_paramStnAppearance, const vvUINT32 &paramStationList, vASL &assocStnList)
Definition dnaioseg.cpp:432
const UINT16 HEADER_20(20)
void strip_duplicates(T &t)
v_stn_appear::iterator it_vstn_appear
Definition dnatypes.hpp:159
vUINT32::const_iterator it_vUINT32_const
Definition dnatypes.hpp:100

References allStationsFixed_, blockCount_, bmsBinaryRecords_, dynadjust::iostreams::dna_io_seg::create_stn_appearance_list(), debug_file, HEADER_20(), projectSettings_, SignalExceptionAdjustment(), strip_duplicates(), unknownParams_, unknownsCount_, v_blockMeta_, v_blockStationsMap_, v_CML_, v_ContiguousNetList_, v_ISL_, v_JSL_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_measurementCount_, v_measurementParams_, v_measurementVarianceCount_, v_parameterStationCount_, v_parameterStationList_, v_paramStnAppearance_, v_rigorousStations_, v_unknownParams_, v_unknownsCount_, and vAssocStnList_.

Referenced by LoadSegmentationFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveInvalidISLStations()

void dynadjust::networkadjust::dna_adjust::RemoveInvalidISLStations ( vUINT32 & v_ISLTemp)
private

Definition at line 14873 of file dnaadjust.cpp.

14874{
14875 CompareValidity<CAStationList, UINT32> aslValidityCompareFunc(&vAssocStnList_, FALSE);
14876 std::sort(v_ISLTemp.begin(), v_ISLTemp.end(), aslValidityCompareFunc);
14877 erase_if(v_ISLTemp, aslValidityCompareFunc);
14878 std::sort(v_ISLTemp.begin(), v_ISLTemp.end());
14879}
void erase_if(T &t, Predicate pred)
#define FALSE
Definition dnatypes.hpp:65

References erase_if(), FALSE, and vAssocStnList_.

Referenced by LoadNetworkFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveNonMeasurements()

void dynadjust::networkadjust::dna_adjust::RemoveNonMeasurements ( const UINT32 & block)
private

Definition at line 14883 of file dnaadjust.cpp.

14884{
14885 if (v_CML_.at(block).size() < 2)
14886 return;
14887 // Strip anything that is not xMeas
14888 CompareNonMeasStart<measurement_t, UINT32> measstartCompareFunc(&bmsBinaryRecords_, xMeas);
14889 std::sort(v_CML_.at(block).begin(), v_CML_.at(block).end(), measstartCompareFunc);
14890 erase_if(v_CML_.at(block), measstartCompareFunc);
14891
14892 // Sort CML on file order (default option)
14893 CompareMsrFileOrder<measurement_t, UINT32> fileorderCompareFunc(&bmsBinaryRecords_);
14894 std::sort(v_CML_.at(block).begin(), v_CML_.at(block).end(), fileorderCompareFunc);
14895
14896}

References bmsBinaryRecords_, erase_if(), v_CML_, and xMeas.

Referenced by LoadNetworkFiles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveDuplicateStations()

void dynadjust::networkadjust::dna_adjust::RemoveDuplicateStations ( vUINT32 & vStns)
private

Definition at line 14860 of file dnaadjust.cpp.

14861{
14862 if (vStations.size() < 2)
14863 return;
14864
14865 strip_duplicates(vStations);
14866}

References strip_duplicates().

Here is the call graph for this function:

◆ InitialiseTypeBUncertainties()

void dynadjust::networkadjust::dna_adjust::InitialiseTypeBUncertainties ( )
private

Definition at line 14346 of file dnaadjust.cpp.

14347{
14348 if (!projectSettings_.o._apply_type_b_global && !projectSettings_.o._apply_type_b_file)
14349 return;
14350
14351 dna_io_tbu tbu;
14352
14353 // Apply global type B uncertainties to all sites
14354 if (projectSettings_.o._apply_type_b_global)
14355 {
14356 // Load the typeb argument. The typeb argument contains type b uncertainties to be
14357 // applied (by default) to all sies
14358 try {
14359
14361 }
14362 catch (const std::runtime_error& e) {
14363 SignalExceptionAdjustment(e.what(), 0);
14364 }
14365 catch (...) {
14366 return;
14367 }
14368 }
14369
14370 // Apply (or overwrite) type B uncertainties to specific sites
14371 if (projectSettings_.o._apply_type_b_file)
14372 {
14373 // load station map
14374 v_string_uint32_pair vStnsMap;
14375 if (projectSettings_.a.map_file.empty())
14376 projectSettings_.a.map_file = projectSettings_.g.input_folder + FOLDER_SLASH + projectSettings_.g.network_name + ".map";
14377 LoadStationMap(&vStnsMap, projectSettings_.a.map_file);
14378
14379 // Load the typeb file. The typeb file contains site-specific type b uncertainties
14380 try {
14381
14382 tbu.load_tbu_file(projectSettings_.a.type_b_file, v_typeBUncertaintiesLocal_, vStnsMap);
14384
14385 // reduce to the cartesian reference frame
14387 }
14388 catch (const std::ifstream::failure& f) {
14389 SignalExceptionAdjustment(f.what(), 0);
14390 }
14391 catch (const std::runtime_error& e) {
14392 SignalExceptionAdjustment(e.what(), 0);
14393 }
14394 }
14395
14396 // Now, set the method of application
14397 UINT32 stn(0);
14399
14400 // Create a vector of elements (with a size equal to the station count) that manages how
14401 // type b uncertainties are to be applied.
14403 // Create a map between station ID and the type b uncertainties vector
14405
14406 for (stn = 0; stn < bstBinaryRecords_.size(); ++stn)
14407 {
14408 v_typeBUncertaintyMethod_.at(stn).station_id = stn;
14409 v_stationTypeBMap_.at(stn).first = stn;
14410 v_stationTypeBMap_.at(stn).second = 0;
14411
14412 // set method to be global by default
14413 if (projectSettings_.o._apply_type_b_global)
14414 {
14415 v_typeBUncertaintyMethod_.at(stn).apply = true;
14417 }
14418
14419 // overwrite global with site specific type b
14420 if (projectSettings_.o._apply_type_b_file)
14421 {
14422 it_tbu = equal_range(v_typeBUncertaintiesLocal_.begin(), v_typeBUncertaintiesLocal_.end(),
14423 stn, CompareTypeBStationID<UINT32, type_b_uncertainty>());
14424 if (it_tbu.first != it_tbu.second)
14425 {
14426 v_typeBUncertaintyMethod_.at(stn).apply = true;
14427 v_typeBUncertaintyMethod_.at(stn).method = type_b_local;
14428
14429 // map the local uncertainty index
14430 v_stationTypeBMap_.at(stn).second = static_cast<UINT32>(std::distance(v_typeBUncertaintiesLocal_.begin(), it_tbu.first));
14431 }
14432 }
14433
14434 }
14435}
void load_tbu_file(const std::string &tbu_filename, v_type_b_uncertainty &type_b_uncertainties, v_string_uint32_pair &vStnsMap)
Definition dnaiotbu.cpp:200
void load_tbu_argument(const std::string &argument, type_b_uncertainty &type_b_uncertainties)
Definition dnaiotbu.cpp:161
void reduce_uncertainties_local(v_type_b_uncertainty &type_b, vstn_t &bstBinaryRecords)
Definition dnaiotbu.cpp:358
v_type_b_uncertainty v_typeBUncertaintiesLocal_
v_uint32_uint32_pair v_stationTypeBMap_
type_b_uncertainty typeBUncertaintyGlobal_
std::pair< it_type_b_uncertainty, it_type_b_uncertainty > it_pair_type_b_uncertainty
Definition dnaiotbu.hpp:82

References bstBinaryRecords_, dynadjust::iostreams::dna_io_tbu::load_tbu_argument(), dynadjust::iostreams::dna_io_tbu::load_tbu_file(), LoadStationMap(), projectSettings_, dynadjust::iostreams::dna_io_tbu::reduce_uncertainties_local(), SignalExceptionAdjustment(), dynadjust::iostreams::type_b_global, dynadjust::iostreams::type_b_local, typeBUncertaintyGlobal_, v_stationTypeBMap_, v_typeBUncertaintiesLocal_, and v_typeBUncertaintyMethod_.

Referenced by PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SortMeasurementsbyType()

void dynadjust::networkadjust::dna_adjust::SortMeasurementsbyType ( v_uint32_u32u32_pair & msr_block)
private

Definition at line 14899 of file dnaadjust.cpp.

14900{
14901 if (msr_block.size() < 2)
14902 return;
14903 CompareMeasType_PairFirst<measurement_t, UINT32> meastypeCompareFunc(&bmsBinaryRecords_);
14904 std::sort(msr_block.begin(), msr_block.end(), meastypeCompareFunc);
14905}

References bmsBinaryRecords_.

Referenced by PrintAdjMeasurements().

Here is the caller graph for this function:

◆ SortMeasurementsbyFromStn()

void dynadjust::networkadjust::dna_adjust::SortMeasurementsbyFromStn ( v_uint32_u32u32_pair & msr_block)
private

Definition at line 14908 of file dnaadjust.cpp.

14909{
14910 if (msr_block.size() < 2)
14911 return;
14912 CompareMeasFromStn_PairFirst<measurement_t, UINT32> measfromstnCompareFunc(&bmsBinaryRecords_);
14913 std::sort(msr_block.begin(), msr_block.end(), measfromstnCompareFunc);
14914}

References bmsBinaryRecords_.

Referenced by PrintAdjMeasurements().

Here is the caller graph for this function:

◆ SortMeasurementsbyToStn()

void dynadjust::networkadjust::dna_adjust::SortMeasurementsbyToStn ( v_uint32_u32u32_pair & msr_block)
private

Definition at line 14917 of file dnaadjust.cpp.

14918{
14919 if (msr_block.size() < 2)
14920 return;
14921 CompareMeasToStn_PairFirst<measurement_t, UINT32> meastostnCompareFunc(&bmsBinaryRecords_);
14922 std::sort(msr_block.begin(), msr_block.end(), meastostnCompareFunc);
14923}

References bmsBinaryRecords_.

Referenced by PrintAdjMeasurements().

Here is the caller graph for this function:

◆ SortMeasurementsbyValue()

void dynadjust::networkadjust::dna_adjust::SortMeasurementsbyValue ( v_uint32_u32u32_pair & msr_block)
private

Definition at line 14926 of file dnaadjust.cpp.

14927{
14928 if (msr_block.size() < 2)
14929 return;
14930 CompareMeasValue_PairFirst<measurement_t, UINT32> measvalueCompareFunc(&bmsBinaryRecords_);
14931 std::sort(msr_block.begin(), msr_block.end(), measvalueCompareFunc);
14932}

References bmsBinaryRecords_.

Referenced by PrintAdjMeasurements().

Here is the caller graph for this function:

◆ SortMeasurementsbyResidual()

void dynadjust::networkadjust::dna_adjust::SortMeasurementsbyResidual ( v_uint32_u32u32_pair & msr_block)
private

Definition at line 14935 of file dnaadjust.cpp.

14936{
14937 if (msr_block.size() < 2)
14938 return;
14939 CompareMeasResidual_PairFirst<measurement_t, UINT32> measresidualCompareFunc(&bmsBinaryRecords_);
14940 std::sort(msr_block.begin(), msr_block.end(), measresidualCompareFunc);
14941}

References bmsBinaryRecords_.

Referenced by PrintAdjMeasurements().

Here is the caller graph for this function:

◆ SortMeasurementsbyAdjSD()

void dynadjust::networkadjust::dna_adjust::SortMeasurementsbyAdjSD ( v_uint32_u32u32_pair & msr_block)
private

Definition at line 14944 of file dnaadjust.cpp.

14945{
14946 if (msr_block.size() < 2)
14947 return;
14948 CompareMeasAdjSD_PairFirst<measurement_t, UINT32> measadjsdCompareFunc(&bmsBinaryRecords_);
14949 std::sort(msr_block.begin(), msr_block.end(), measadjsdCompareFunc);
14950}

References bmsBinaryRecords_.

Referenced by PrintAdjMeasurements().

Here is the caller graph for this function:

◆ SortMeasurementsbyNstat()

void dynadjust::networkadjust::dna_adjust::SortMeasurementsbyNstat ( v_uint32_u32u32_pair & msr_block)
private

Definition at line 14953 of file dnaadjust.cpp.

14954{
14955 if (msr_block.size() < 2)
14956 return;
14957 CompareMeasNstat_PairFirst<measurement_t, UINT32> measnstatCompareFunc(&bmsBinaryRecords_);
14958 std::sort(msr_block.begin(), msr_block.end(), measnstatCompareFunc);
14959}

References bmsBinaryRecords_.

Referenced by PrintAdjMeasurements().

Here is the caller graph for this function:

◆ SortStationsbyFileOrder()

void dynadjust::networkadjust::dna_adjust::SortStationsbyFileOrder ( vUINT32 & v_blockStations)
private

Definition at line 10019 of file dnaadjust.cpp.

10020{
10021 CompareStnFileOrder<station_t, UINT32> stnorderCompareFunc(&bstBinaryRecords_);
10022 std::sort(v_blockStations.begin(), v_blockStations.end(), stnorderCompareFunc);
10023}

References bstBinaryRecords_.

Referenced by PrintAdjStations(), PrintCorStations(), and PrintPosUncertainties().

Here is the caller graph for this function:

◆ SortStationsbyID()

void dynadjust::networkadjust::dna_adjust::SortStationsbyID ( vUINT32 & v_blockStations)
private

Definition at line 10025 of file dnaadjust.cpp.

10026{
10027 std::sort(v_blockStations.begin(), v_blockStations.end());
10028}

Referenced by PrintAdjStations(), PrintCorStations(), and PrintPosUncertainties().

Here is the caller graph for this function:

◆ SetRegionOffsets()

void dynadjust::networkadjust::dna_adjust::SetRegionOffsets ( const UINT32 & block,
const int file_count = 0,
... )
private

Definition at line 60 of file dnaadjust-stage.cpp.

61{
62 if (file_count == 0)
63 {
64 // deserialise all. That is, call this function again, but with
65 // arguments for all files
66 SetRegionOffsets(block, 12,
71 return;
72 }
73
74 va_list vlist;
75 va_start(vlist, file_count);
76
77 for (UINT16 file(0); file<file_count; ++file)
78 {
79 switch (va_arg(vlist, int))
80 {
81 case sf_normals_r:
82 normalsR_map_.addblockMapRegion(block_map_t(v_normalsR_.at(block).get_size()));
84 break;
86 measMinusComp_map_.addblockMapRegion(block_map_t(v_measMinusComp_.at(block).get_size()));
88 break;
90 estimatedStations_map_.addblockMapRegion(block_map_t(v_estimatedStations_.at(block).get_size()));
92 break;
94 originalStations_map_.addblockMapRegion(block_map_t(v_originalStations_.at(block).get_size()));
96 break;
98 rigorousStations_map_.addblockMapRegion(block_map_t(v_rigorousStations_.at(block).get_size()));
100 break;
101 case sf_junction_vars:
102 junctionVariances_map_.addblockMapRegion(block_map_t(v_junctionVariances_.at(block).get_size()));
104 break;
106 junctionVariancesFwd_map_.addblockMapRegion(block_map_t(v_junctionVariancesFwd_.at(block).get_size()));
108 break;
110 junctionEstimatesFwd_map_.addblockMapRegion(block_map_t(v_junctionEstimatesFwd_.at(block).get_size()));
112 break;
114 junctionEstimatesRev_map_.addblockMapRegion(block_map_t(v_junctionEstimatesRev_.at(block).get_size()));
116 break;
117 case sf_rigorous_vars:
118 rigorousVariances_map_.addblockMapRegion(block_map_t(v_rigorousVariances_.at(block).get_size()));
120 break;
121 case sf_prec_adj_msrs:
122 precAdjMsrs_map_.addblockMapRegion(block_map_t(v_precAdjMsrsFull_.at(block).get_size()));
124 break;
125 case sf_corrections:
126 corrections_map_.addblockMapRegion(block_map_t(v_corrections_.at(block).get_size()));
128 break;
129 }
130 }
131 va_end(vlist);
132}
void SetRegionOffset(vmat_file_map &file_map)
@ sf_corrections
Definition dnatypes.hpp:463
@ sf_normals_r
Definition dnatypes.hpp:450
@ sf_meas_minus_comp
Definition dnatypes.hpp:453
@ sf_junction_vars
Definition dnatypes.hpp:457
@ sf_junction_ests_r
Definition dnatypes.hpp:460
@ sf_junction_ests_f
Definition dnatypes.hpp:459
@ sf_junction_vars_f
Definition dnatypes.hpp:458

References corrections_map_, estimatedStations_map_, junctionEstimatesFwd_map_, junctionEstimatesRev_map_, junctionVariances_map_, junctionVariancesFwd_map_, measMinusComp_map_, normalsR_map_, originalStations_map_, precAdjMsrs_map_, rigorousStations_map_, rigorousVariances_map_, SetRegionOffset(), SetRegionOffsets(), sf_corrections, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, sf_rigorous_vars, v_corrections_, v_estimatedStations_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_measMinusComp_, v_normalsR_, v_originalStations_, v_precAdjMsrsFull_, v_rigorousStations_, and v_rigorousVariances_.

Referenced by DeSerialiseAdjustedVarianceMatrices(), PrepareAdjustmentBlock(), PrepareMappedRegions(), SerialiseAdjustedVarianceMatrices(), and SetRegionOffsets().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetRegionOffset()

void dynadjust::networkadjust::dna_adjust::SetRegionOffset ( vmat_file_map & file_map)
private

Definition at line 135 of file dnaadjust-stage.cpp.

136{
137 // Get iterator to the second last mapped region
138 _it_block_map _it_bmap_prev(file_map.vblockMapRegions_.end() - 1);
139 if (_it_bmap_prev == file_map.vblockMapRegions_.begin())
140 return;
141 _it_bmap_prev--;
142 // Get iterator to the last mapped region
143 _it_block_map _it_bmap(file_map.vblockMapRegions_.end() - 1);
144 // Set region offset for the last mapped region
145 _it_bmap->SetRegionOffset(_it_bmap_prev->GetCumulativeRegionOffset());
146}
vblock_map::iterator _it_block_map

References dynadjust::memory::vmat_file_map::vblockMapRegions_.

Referenced by SetRegionOffsets().

Here is the caller graph for this function:

◆ SetMapRegions()

void dynadjust::networkadjust::dna_adjust::SetMapRegions ( const int file_count = 0,
... )
private

Definition at line 544 of file dnaadjust-stage.cpp.

545{
546 if (file_count == 0)
547 {
548 // serialise all. That is, call this function again, but with
549 // arguments for all files
550 SetMapRegions(12,
555 return;
556 }
557
558 va_list vlist;
559 va_start(vlist, file_count);
560
561 for (UINT16 file(0); file<file_count; ++file)
562 {
563 switch (va_arg(vlist, int))
564 {
565 case sf_normals_r:
566
567 // Create file map, and associate the regions with the normals blocks in the file
568 normalsR_map_.CreateFileMap(); // File path set in OpenStageFileStreams
569 for_each(
570 normalsR_map_.vblockMapRegions_.begin(),
571 normalsR_map_.vblockMapRegions_.end(),
572 [this] (block_map_t& block_map) { // use lambda expression
573 block_map.MapRegion(normalsR_map_.getFileMapPtr());
574 }
575 );
576
577 break;
579
580 // Create file map, and associate the regions with the normals blocks in the file
581 measMinusComp_map_.CreateFileMap(); // File path set in OpenStageFileStreams
582 for_each(
583 measMinusComp_map_.vblockMapRegions_.begin(),
584 measMinusComp_map_.vblockMapRegions_.end(),
585 [this] (block_map_t& block_map) { // use lambda expression
586 block_map.MapRegion(measMinusComp_map_.getFileMapPtr());
587 }
588 );
589
590 break;
592
593 // Create file map, and associate the regions with the normals blocks in the file
594 estimatedStations_map_.CreateFileMap(); // File path set in OpenStageFileStreams
595 for_each(
596 estimatedStations_map_.vblockMapRegions_.begin(),
597 estimatedStations_map_.vblockMapRegions_.end(),
598 [this] (block_map_t& block_map) { // use lambda expression
599 block_map.MapRegion(estimatedStations_map_.getFileMapPtr());
600 }
601 );
602
603 break;
604 case sf_original_stns:
605
606 // Create file map, and associate the regions with the normals blocks in the file
607 originalStations_map_.CreateFileMap(); // File path set in OpenStageFileStreams
608 for_each(
609 originalStations_map_.vblockMapRegions_.begin(),
610 originalStations_map_.vblockMapRegions_.end(),
611 [this] (block_map_t& block_map) { // use lambda expression
612 block_map.MapRegion(originalStations_map_.getFileMapPtr());
613 }
614 );
615
616 break;
617 case sf_rigorous_stns:
618
619 // Create file map, and associate the regions with the normals blocks in the file
620 rigorousStations_map_.CreateFileMap(); // File path set in OpenStageFileStreams
621 for_each(
622 rigorousStations_map_.vblockMapRegions_.begin(),
623 rigorousStations_map_.vblockMapRegions_.end(),
624 [this] (block_map_t& block_map) { // use lambda expression
625 block_map.MapRegion(rigorousStations_map_.getFileMapPtr());
626 }
627 );
628
629 break;
630 case sf_junction_vars:
631
632 // Create file map, and associate the regions with the normals blocks in the file
633 junctionVariances_map_.CreateFileMap(); // File path set in OpenStageFileStreams
634 for_each(
635 junctionVariances_map_.vblockMapRegions_.begin(),
636 junctionVariances_map_.vblockMapRegions_.end(),
637 [this] (block_map_t& block_map) { // use lambda expression
638 block_map.MapRegion(junctionVariances_map_.getFileMapPtr());
639 }
640 );
641
642 break;
644
645 // Create file map, and associate the regions with the normals blocks in the file
646 junctionVariancesFwd_map_.CreateFileMap(); // File path set in OpenStageFileStreams
647 for_each(
648 junctionVariancesFwd_map_.vblockMapRegions_.begin(),
649 junctionVariancesFwd_map_.vblockMapRegions_.end(),
650 [this] (block_map_t& block_map) { // use lambda expression
651 block_map.MapRegion(junctionVariancesFwd_map_.getFileMapPtr());
652 }
653 );
654
655 break;
657
658 // Create file map, and associate the regions with the normals blocks in the file
659 junctionEstimatesFwd_map_.CreateFileMap(); // File path set in OpenStageFileStreams
660 for_each(
661 junctionEstimatesFwd_map_.vblockMapRegions_.begin(),
662 junctionEstimatesFwd_map_.vblockMapRegions_.end(),
663 [this] (block_map_t& block_map) { // use lambda expression
664 block_map.MapRegion(junctionEstimatesFwd_map_.getFileMapPtr());
665 }
666 );
667
668 break;
670
671 // Create file map, and associate the regions with the normals blocks in the file
672 junctionEstimatesRev_map_.CreateFileMap(); // File path set in OpenStageFileStreams
673 for_each(
674 junctionEstimatesRev_map_.vblockMapRegions_.begin(),
675 junctionEstimatesRev_map_.vblockMapRegions_.end(),
676 [this] (block_map_t& block_map) { // use lambda expression
677 block_map.MapRegion(junctionEstimatesRev_map_.getFileMapPtr());
678 }
679 );
680
681 break;
682 case sf_rigorous_vars:
683
684 // Create file map, and associate the regions with the normals blocks in the file
685 rigorousVariances_map_.CreateFileMap(); // File path set in OpenStageFileStreams
686 for_each(
687 rigorousVariances_map_.vblockMapRegions_.begin(),
688 rigorousVariances_map_.vblockMapRegions_.end(),
689 [this] (block_map_t& block_map) { // use lambda expression
690 block_map.MapRegion(rigorousVariances_map_.getFileMapPtr());
691 }
692 );
693
694 break;
695 case sf_prec_adj_msrs:
696
697 // Create file map, and associate the regions with the normals blocks in the file
698 precAdjMsrs_map_.CreateFileMap(); // File path set in OpenStageFileStreams
699 for_each(
700 precAdjMsrs_map_.vblockMapRegions_.begin(),
701 precAdjMsrs_map_.vblockMapRegions_.end(),
702 [this] (block_map_t& block_map) { // use lambda expression
703 block_map.MapRegion(precAdjMsrs_map_.getFileMapPtr());
704 }
705 );
706
707 break;
708 case sf_corrections:
709
710 // Create file map, and associate the regions with the normals blocks in the file
711 corrections_map_.CreateFileMap(); // File path set in OpenStageFileStreams
712 for_each(
713 corrections_map_.vblockMapRegions_.begin(),
714 corrections_map_.vblockMapRegions_.end(),
715 [this] (block_map_t& block_map) { // use lambda expression
716 block_map.MapRegion(corrections_map_.getFileMapPtr());
717 }
718 );
719
720 break;
721 }
722 }
723 va_end(vlist);
724}

References corrections_map_, estimatedStations_map_, junctionEstimatesFwd_map_, junctionEstimatesRev_map_, junctionVariances_map_, junctionVariancesFwd_map_, measMinusComp_map_, normalsR_map_, originalStations_map_, precAdjMsrs_map_, rigorousStations_map_, rigorousVariances_map_, SetMapRegions(), sf_corrections, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, and sf_rigorous_vars.

Referenced by DeSerialiseAdjustedVarianceMatrices(), PrepareAdjustment(), and SetMapRegions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareMemoryMapRegions()

void dynadjust::networkadjust::dna_adjust::PrepareMemoryMapRegions ( const UINT32 & block,
const int file_count = 0,
... )
private

Definition at line 727 of file dnaadjust-stage.cpp.

728{
729 if (file_count == 0)
730 {
731 // serialise all. That is, call this function again, but with
732 // arguments for all files
733 PrepareMemoryMapRegions(block, 12,
738 return;
739 }
740
741 va_list vlist;
742 va_start(vlist, file_count);
743
744 for (UINT16 file(0); file<file_count; ++file)
745 {
746 switch (va_arg(vlist, int))
747 {
748 case sf_normals_r:
749
750 // Create file map, and associate the regions with the normals blocks in the file
751 normalsR_map_.CreateFileMap(); // File path set in OpenStageFileStreams
752 normalsR_map_.MapRegion(block);
753
754 break;
756
757 // Create file map, and associate the regions with the normals blocks in the file
758 measMinusComp_map_.CreateFileMap(); // File path set in OpenStageFileStreams
759 measMinusComp_map_.MapRegion(block);
760
761 break;
763
764 // Create file map, and associate the regions with the normals blocks in the file
765 estimatedStations_map_.CreateFileMap(); // File path set in OpenStageFileStreams
766 estimatedStations_map_.MapRegion(block);
767
768 break;
769 case sf_original_stns:
770
771 // Create file map, and associate the regions with the normals blocks in the file
772 originalStations_map_.CreateFileMap(); // File path set in OpenStageFileStreams
773 originalStations_map_.MapRegion(block);
774
775 break;
776 case sf_rigorous_stns:
777
778 // Create file map, and associate the regions with the normals blocks in the file
779 rigorousStations_map_.CreateFileMap(); // File path set in OpenStageFileStreams
780 rigorousStations_map_.MapRegion(block);
781
782 break;
783 case sf_junction_vars:
784
785 // Create file map, and associate the regions with the normals blocks in the file
786 junctionVariances_map_.CreateFileMap(); // File path set in OpenStageFileStreams
787 junctionVariances_map_.MapRegion(block);
788
789 break;
791
792 // Create file map, and associate the regions with the normals blocks in the file
793 junctionVariancesFwd_map_.CreateFileMap(); // File path set in OpenStageFileStreams
794 junctionVariancesFwd_map_.MapRegion(block);
795
796 break;
798
799 // Create file map, and associate the regions with the normals blocks in the file
800 junctionEstimatesFwd_map_.CreateFileMap(); // File path set in OpenStageFileStreams
801 junctionEstimatesFwd_map_.MapRegion(block);
802
803 break;
805
806 // Create file map, and associate the regions with the normals blocks in the file
807 junctionEstimatesRev_map_.CreateFileMap(); // File path set in OpenStageFileStreams
808 junctionEstimatesRev_map_.MapRegion(block);
809
810 break;
811 case sf_rigorous_vars:
812
813 // Create file map, and associate the regions with the normals blocks in the file
814 rigorousVariances_map_.CreateFileMap(); // File path set in OpenStageFileStreams
815 rigorousVariances_map_.MapRegion(block);
816
817 break;
818 case sf_prec_adj_msrs:
819
820 // Create file map, and associate the regions with the normals blocks in the file
821 precAdjMsrs_map_.CreateFileMap(); // File path set in OpenStageFileStreams
822 precAdjMsrs_map_.MapRegion(block);
823
824 break;
825 case sf_corrections:
826
827 // Create file map, and associate the regions with the normals blocks in the file
828 corrections_map_.CreateFileMap(); // File path set in OpenStageFileStreams
829 corrections_map_.MapRegion(block);
830
831 break;
832 }
833 }
834 va_end(vlist);
835}

References corrections_map_, estimatedStations_map_, junctionEstimatesFwd_map_, junctionEstimatesRev_map_, junctionVariances_map_, junctionVariancesFwd_map_, measMinusComp_map_, normalsR_map_, originalStations_map_, precAdjMsrs_map_, PrepareMemoryMapRegions(), rigorousStations_map_, rigorousVariances_map_, sf_corrections, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, and sf_rigorous_vars.

Referenced by DeSerialiseAdjustedVarianceMatrices(), PrepareMappedRegions(), and PrepareMemoryMapRegions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OffloadBlockToDisk()

void dynadjust::networkadjust::dna_adjust::OffloadBlockToDisk ( const UINT32 & block)
private

Definition at line 838 of file dnaadjust-stage.cpp.

839{
840 // Write block matrix data to disk
842
843 // Unload block matrix data from memory
844 UnloadBlock(block);
845}
void SerialiseBlockToDisk(const UINT32 &block)

References SerialiseBlockToDisk(), and UnloadBlock().

Referenced by PrepareAdjustmentBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OffloadBlockToMappedFile()

void dynadjust::networkadjust::dna_adjust::OffloadBlockToMappedFile ( const UINT32 & block)
private

Definition at line 848 of file dnaadjust-stage.cpp.

849{
850 // Write block matrix data to disk
852
853 // Unload block matrix data from memory
854 UnloadBlock(block);
855}

References SerialiseBlockToMappedFile(), and UnloadBlock().

Referenced by AdjustPhasedForward(), AdjustPhasedReverse(), AdjustPhasedReverseCombine(), and PrepareAdjustmentReverse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SerialiseBlockToDisk()

void dynadjust::networkadjust::dna_adjust::SerialiseBlockToDisk ( const UINT32 & block)
private

Definition at line 858 of file dnaadjust-stage.cpp.

859{
860 // Write block matrix data to disk
861 try {
862 // Normals - reverse
863 f_normalsR_ << v_normalsR_.at(block); // ...neqr.mtx
864 // Measured minus computed
865 f_measMinusComp_ << v_measMinusComp_.at(block); // ...mmc.mtx
866 // Estimated stations
867 f_estimatedStations_ << v_estimatedStations_.at(block); // ...est.mtx
868 // original stations
869 f_originalStations_ << v_originalStations_.at(block); // ...ost.mtx
870 // Rigorous stations
871 f_rigorousStations_ << v_rigorousStations_.at(block); // ...rst.mtx
872 // Junction variances
873 f_junctionVariances_ << v_junctionVariances_.at(block); // ...jva.mtx
874 // Junction variances forward
875 f_junctionVariancesFwd_ << v_junctionVariancesFwd_.at(block); // ...jvf.mtx
876 // Junction estimates forward
877 f_junctionEstimatesFwd_ << v_junctionEstimatesFwd_.at(block); // ...jef.mtx
878 // Junction estimates reverse
879 f_junctionEstimatesRev_ << v_junctionEstimatesRev_.at(block); // ...jer.mtx
880 // Rigorous variances
881 f_rigorousVariances_ << v_rigorousVariances_.at(block); // ...rva.mtx
882 // Precision adjusted measurements
883 f_precAdjMsrs_ << v_precAdjMsrsFull_.at(block); // ...pam.mtx
884 // Corrections
885 f_corrections_ << v_corrections_.at(block); // ...cor.mtx
886 }
887 catch (...) {
888 std::stringstream ss;
889 ss << "SerialiseBlockToDisk(): An error was encountered when writing matrix data to disk." << std::endl;
890 SignalExceptionAdjustment(ss.str(), 0);
891 }
892}

References f_corrections_, f_estimatedStations_, f_junctionEstimatesFwd_, f_junctionEstimatesRev_, f_junctionVariances_, f_junctionVariancesFwd_, f_measMinusComp_, f_normalsR_, f_originalStations_, f_precAdjMsrs_, f_rigorousStations_, f_rigorousVariances_, SignalExceptionAdjustment(), v_corrections_, v_estimatedStations_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_measMinusComp_, v_normalsR_, v_originalStations_, v_precAdjMsrsFull_, v_rigorousStations_, and v_rigorousVariances_.

Referenced by OffloadBlockToDisk().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SerialiseBlockToMappedFile()

void dynadjust::networkadjust::dna_adjust::SerialiseBlockToMappedFile ( const UINT32 & block,
const int file_count = 0,
... )
private

Definition at line 238 of file dnaadjust-stage.cpp.

239{
240 if (file_count == 0)
241 {
242 // serialise all. That is, call this function again, but with
243 // arguments for all files
249 return;
250 }
251
252 va_list vlist;
253 va_start(vlist, file_count);
254
255 void* addr;
256
257 for (UINT16 file(0); file<file_count; ++file)
258 {
259 switch (va_arg(vlist, int))
260 {
261 case sf_normals:
262 break;
263 case sf_normals_r:
264 addr = normalsR_map_.GetBlockRegionAddr(block);
265 v_normalsR_.at(block).WriteMappedFileRegion(addr);
266 break;
267 case sf_atvinv:
268 break;
269 case sf_design:
270 break;
272 addr = measMinusComp_map_.GetBlockRegionAddr(block);
273 v_measMinusComp_.at(block).WriteMappedFileRegion(addr);
274 break;
276 addr = estimatedStations_map_.GetBlockRegionAddr(block);
277 v_estimatedStations_.at(block).WriteMappedFileRegion(addr);
278 break;
279 case sf_original_stns:
280 addr = originalStations_map_.GetBlockRegionAddr(block);
281 v_originalStations_.at(block).WriteMappedFileRegion(addr);
282 break;
283 case sf_rigorous_stns:
284 addr = rigorousStations_map_.GetBlockRegionAddr(block);
285 v_rigorousStations_.at(block).WriteMappedFileRegion(addr);
286 break;
287 case sf_junction_vars:
288 addr = junctionVariances_map_.GetBlockRegionAddr(block);
289 v_junctionVariances_.at(block).WriteMappedFileRegion(addr);
290 break;
292 addr = junctionVariancesFwd_map_.GetBlockRegionAddr(block);
293 v_junctionVariancesFwd_.at(block).WriteMappedFileRegion(addr);
294 break;
296 addr = junctionEstimatesFwd_map_.GetBlockRegionAddr(block);
297 v_junctionEstimatesFwd_.at(block).WriteMappedFileRegion(addr);
298 break;
300 addr = junctionEstimatesRev_map_.GetBlockRegionAddr(block);
301 v_junctionEstimatesRev_.at(block).WriteMappedFileRegion(addr);
302 break;
303 case sf_rigorous_vars:
304 addr = rigorousVariances_map_.GetBlockRegionAddr(block);
305 v_rigorousVariances_.at(block).WriteMappedFileRegion(addr);
306 break;
307 case sf_prec_adj_msrs:
308 addr = precAdjMsrs_map_.GetBlockRegionAddr(block);
309 v_precAdjMsrsFull_.at(block).WriteMappedFileRegion(addr);
310 break;
311 case sf_corrections:
312 addr = corrections_map_.GetBlockRegionAddr(block);
313 v_corrections_.at(block).WriteMappedFileRegion(addr);
314 break;
315 }
316 }
317 va_end(vlist);
318}
@ sf_atvinv
Definition dnatypes.hpp:451
@ sf_design
Definition dnatypes.hpp:452

References corrections_map_, estimatedStations_map_, junctionEstimatesFwd_map_, junctionEstimatesRev_map_, junctionVariances_map_, junctionVariancesFwd_map_, measMinusComp_map_, normalsR_map_, originalStations_map_, precAdjMsrs_map_, rigorousStations_map_, rigorousVariances_map_, SerialiseBlockToMappedFile(), sf_atvinv, sf_corrections, sf_design, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, sf_rigorous_vars, v_corrections_, v_estimatedStations_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_measMinusComp_, v_normalsR_, v_originalStations_, v_precAdjMsrsFull_, v_rigorousStations_, and v_rigorousVariances_.

Referenced by OffloadBlockToMappedFile(), PrintAdjStationsUniqueList(), PrintAdjustedNetworkStations(), SerialiseBlockToMappedFile(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DeserialiseBlockFromMappedFile()

void dynadjust::networkadjust::dna_adjust::DeserialiseBlockFromMappedFile ( const UINT32 & block,
const int count = 0,
... )
private

Definition at line 149 of file dnaadjust-stage.cpp.

150{
151 if (file_count == 0)
152 {
153 // deserialise all. That is, call this function again, but with
154 // arguments for all files
160 return;
161 }
162
163 va_list vlist;
164 va_start(vlist, file_count);
165
166 void* addr;
167
168 for (UINT16 file(0); file<file_count; ++file)
169 {
170 switch (va_arg(vlist, int))
171 {
172 case sf_normals:
173 v_normals_.at(block).allocate();
174 break;
175 case sf_normals_r:
176 addr = normalsR_map_.GetBlockRegionAddr(block);
177 v_normalsR_.at(block).ReadMappedFileRegion(addr);
178 break;
179 case sf_atvinv:
180 v_AtVinv_.at(block).allocate();
181 break;
182 case sf_design:
183 v_design_.at(block).allocate();
184 break;
186 addr = measMinusComp_map_.GetBlockRegionAddr(block);
187 v_measMinusComp_.at(block).ReadMappedFileRegion(addr);
188 break;
190 addr = estimatedStations_map_.GetBlockRegionAddr(block);
191 v_estimatedStations_.at(block).ReadMappedFileRegion(addr);
192 break;
193 case sf_original_stns:
194 addr = originalStations_map_.GetBlockRegionAddr(block);
195 v_originalStations_.at(block).ReadMappedFileRegion(addr);
196 break;
197 case sf_rigorous_stns:
198 addr = rigorousStations_map_.GetBlockRegionAddr(block);
199 v_rigorousStations_.at(block).ReadMappedFileRegion(addr);
200 break;
201 case sf_junction_vars:
202 addr = junctionVariances_map_.GetBlockRegionAddr(block);
203 v_junctionVariances_.at(block).ReadMappedFileRegion(addr);
204 break;
206 addr = junctionVariancesFwd_map_.GetBlockRegionAddr(block);
207 v_junctionVariancesFwd_.at(block).ReadMappedFileRegion(addr);
208 break;
210 addr = junctionEstimatesFwd_map_.GetBlockRegionAddr(block);
211 v_junctionEstimatesFwd_.at(block).ReadMappedFileRegion(addr);
212 break;
214 addr = junctionEstimatesRev_map_.GetBlockRegionAddr(block);
215 v_junctionEstimatesRev_.at(block).ReadMappedFileRegion(addr);
216 break;
217 case sf_rigorous_vars:
218 addr = rigorousVariances_map_.GetBlockRegionAddr(block);
219 v_rigorousVariances_.at(block).ReadMappedFileRegion(addr);
220 break;
221 case sf_prec_adj_msrs:
222 addr = precAdjMsrs_map_.GetBlockRegionAddr(block);
223 v_precAdjMsrsFull_.at(block).ReadMappedFileRegion(addr);
224 break;
225 case sf_corrections:
226 addr = corrections_map_.GetBlockRegionAddr(block);
227 v_corrections_.at(block).ReadMappedFileRegion(addr);
228
229 if (v_blockMeta_.at(block)._blockLast)
230 v_correctionsR_.at(block).allocate();
231
232 break;
233 }
234 }
235 va_end(vlist);
236}

References corrections_map_, DeserialiseBlockFromMappedFile(), estimatedStations_map_, junctionEstimatesFwd_map_, junctionEstimatesRev_map_, junctionVariances_map_, junctionVariancesFwd_map_, measMinusComp_map_, normalsR_map_, originalStations_map_, precAdjMsrs_map_, rigorousStations_map_, rigorousVariances_map_, sf_atvinv, sf_corrections, sf_design, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, sf_rigorous_vars, v_AtVinv_, v_blockMeta_, v_corrections_, v_correctionsR_, v_design_, v_estimatedStations_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_measMinusComp_, v_normals_, v_normalsR_, v_originalStations_, v_precAdjMsrsFull_, v_rigorousStations_, and v_rigorousVariances_.

Referenced by AdjustPhasedForward(), AdjustPhasedReverse(), CarryForwardJunctions(), CarryReverseJunctions(), ComputeAdjustedMsrPrecisions(), ComputeandPrintAdjMsrOnIteration(), ComputeChiSquareNetwork(), DeSerialiseAdjustedVarianceMatrices(), DeserialiseBlockFromMappedFile(), OutputLargestCorrection(), PrintAdjGNSSAlternateUnits(), PrintAdjStationsUniqueList(), PrintAdjustedNetworkStations(), PrintCorStationsUniqueList(), PrintEstimatedStationCoordinatestoDNAXML_Y(), PrintEstimatedStationCoordinatestoSNX(), PrintNetworkStationCorrections(), PrintPositionalUncertainty(), PrintPosUncertaintiesUniqueList(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UnloadBlock()

void dynadjust::networkadjust::dna_adjust::UnloadBlock ( const UINT32 & block,
const int file_count = 0,
... )
private

Definition at line 895 of file dnaadjust-stage.cpp.

896{
897 if (file_count == 0)
898 {
899 // deserialise all
900 UnloadBlock(block, 16,
905 return;
906 }
907
908 va_list vlist;
909 va_start(vlist, file_count);
910
911 // Unload block matrix data from memory
912 for (UINT16 file(0); file<file_count; ++file)
913 {
914 switch (va_arg(vlist, int))
915 {
916 case sf_normals:
917 v_normals_.at(block).~matrix_2d();
918 break;
919 case sf_normals_r:
920 v_normalsR_.at(block).~matrix_2d();
921 break;
922 case sf_atvinv:
923 v_AtVinv_.at(block).~matrix_2d();
924 break;
925 case sf_design:
926 v_design_.at(block).~matrix_2d();
927 break;
929 v_measMinusComp_.at(block).~matrix_2d();
930 break;
932 v_estimatedStations_.at(block).~matrix_2d();
933 break;
934 case sf_original_stns:
935 v_originalStations_.at(block).~matrix_2d();
936 break;
937 case sf_rigorous_stns:
938 v_rigorousStations_.at(block).~matrix_2d();
939 break;
940 case sf_junction_vars:
941 v_junctionVariances_.at(block).~matrix_2d();
942 break;
944 v_junctionVariancesFwd_.at(block).~matrix_2d();
945 break;
947 v_junctionEstimatesFwd_.at(block).~matrix_2d();
948 break;
950 v_junctionEstimatesRev_.at(block).~matrix_2d();
951 break;
952 case sf_rigorous_vars:
953 v_rigorousVariances_.at(block).~matrix_2d();
954 break;
955 case sf_prec_adj_msrs:
956 v_precAdjMsrsFull_.at(block).~matrix_2d();
957 break;
958 case sf_corrections:
959 v_corrections_.at(block).~matrix_2d();
960
961 if (v_blockMeta_.at(block)._blockLast)
962 v_correctionsR_.at(block).~matrix_2d();
963 break;
964 }
965 }
966 va_end(vlist);
967}

References sf_atvinv, sf_corrections, sf_design, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, sf_rigorous_vars, UnloadBlock(), v_AtVinv_, v_blockMeta_, v_corrections_, v_correctionsR_, v_design_, v_estimatedStations_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_measMinusComp_, v_normals_, v_normalsR_, v_originalStations_, v_precAdjMsrsFull_, v_rigorousStations_, and v_rigorousVariances_.

Referenced by ComputeAdjustedMsrPrecisions(), ComputeandPrintAdjMsrOnIteration(), ComputeChiSquareNetwork(), OffloadBlockToDisk(), OffloadBlockToMappedFile(), OutputLargestCorrection(), PrintAdjGNSSAlternateUnits(), PrintAdjStationsUniqueList(), PrintAdjustedNetworkStations(), PrintCorStationsUniqueList(), PrintEstimatedStationCoordinatestoDNAXML_Y(), PrintEstimatedStationCoordinatestoSNX(), PrintNetworkStationCorrections(), PrintPositionalUncertainty(), PrintPosUncertaintiesUniqueList(), UnloadBlock(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PurgeMatricesFromDisk()

void dynadjust::networkadjust::dna_adjust::PurgeMatricesFromDisk ( )
private

Definition at line 3819 of file dnaadjust.cpp.

3820{
3821 // remove all the files
3822 for_each(
3823 v_stageFileStreams_.begin(),
3824 v_stageFileStreams_.end(),
3825 [](std::string str){ // use lambda expression
3826
3827 // remove mapping
3828 boost::interprocess::file_mapping::remove(str.c_str());
3829 // If the file still exists, remove it!
3830 if (boost::filesystem::exists(str))
3831 boost::interprocess::file_mapping::remove(str.c_str());
3832 }
3833 );
3834}

References v_stageFileStreams_.

◆ AddMsrtoMeasMinusComp()

void dynadjust::networkadjust::dna_adjust::AddMsrtoMeasMinusComp ( pit_vmsr_t _it_msr,
const UINT32 & design_row,
const double comp_msr,
matrix_2d * measMinusComp,
bool printBlock = true )
private

Definition at line 5724 of file dnaadjust.cpp.

5726{
5727 double mmc((*_it_msr)->term1 - comp_msr);
5728
5729 switch ((*_it_msr)->measType)
5730 {
5731 case 'A':
5732 case 'B':
5733 case 'D':
5734 case 'K':
5735 // check if residual is close to +/- 360 (make close to 0)
5736 if (mmc < -5.5)
5737 mmc += TWO_PI;
5738 else if (mmc > 5.5)
5739 mmc -= TWO_PI;
5740 }
5741
5742 // measured - computed
5743 measMinusComp->put(design_row, 0, mmc);
5744
5745 if (projectSettings_.g.verbose > 5)
5746 {
5747 if (printBlock)
5748 debug_file << bstBinaryRecords_.at((*_it_msr)->station1).stationName <<
5749 " - " << bstBinaryRecords_.at((*_it_msr)->station2).stationName;
5750 debug_file << std::endl;
5751 debug_file << "d" << (*_it_msr)->measType << " " << std::fixed << std::setprecision(16) << std::setw(26) <<
5752 mmc <<
5753 " = " << std::setw(26) << (*_it_msr)->term1 <<
5754 " - " << std::setw(26) << comp_msr << " ";
5755 }
5756}
const double TWO_PI(PI+PI)

References bstBinaryRecords_, debug_file, projectSettings_, dynadjust::math::matrix_2d::put(), and TWO_PI().

Referenced by UpdateDesignMeasMatrices_GX(), UpdateDesignNormalMeasMatrices_A(), UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_CEM(), UpdateDesignNormalMeasMatrices_HR(), UpdateDesignNormalMeasMatrices_IP(), UpdateDesignNormalMeasMatrices_JQ(), UpdateDesignNormalMeasMatrices_L(), UpdateDesignNormalMeasMatrices_S(), UpdateDesignNormalMeasMatrices_V(), UpdateDesignNormalMeasMatrices_Y(), and UpdateDesignNormalMeasMatrices_Z().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddMsrtoNormalsVar()

void dynadjust::networkadjust::dna_adjust::AddMsrtoNormalsVar ( const UINT32 & design_row,
const UINT32 & stn,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1599 of file dnaadjust.cpp.

1601{
1602 // Add weighted measurement contributions to normal matrix
1603 for (UINT32 row, col(0); col<3; ++col)
1604 {
1605 for (row=0; row<3; ++row)
1606 {
1607 normals->elementadd(stn+row, stn+col,
1608 AtVinv->get(stn+row, design_row) * design->get(design_row, stn+col));
1609 }
1610 }
1611}
void elementadd(const index_t &r, const index_t &c, const double &inc)
double & get(const index_t &r, const index_t &c) const

References dynadjust::math::matrix_2d::elementadd(), and dynadjust::math::matrix_2d::get().

Referenced by UpdateNormals_A(), UpdateNormals_BCEKLMSVZ(), and UpdateNormals_HIJPQR().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddMsrtoNormalsCoVar2()

void dynadjust::networkadjust::dna_adjust::AddMsrtoNormalsCoVar2 ( const UINT32 & design_row,
const UINT32 & stn1,
const UINT32 & stn2,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1614 of file dnaadjust.cpp.

1616{
1617 // Add covariance terms (station 1 and station 2) to normal matrix
1618 for (UINT32 row, col(0); col<3; ++col)
1619 {
1620 for (row=0; row<3; ++row)
1621 {
1622 // 1-2
1623 normals->elementadd(stn1+row, stn2+col,
1624 AtVinv->get(stn1+row, design_row) * design->get(design_row, stn2+col));
1625
1626 normals->elementadd(stn2+row, stn1+col,
1627 AtVinv->get(stn2+row, design_row) * design->get(design_row, stn1+col));
1628 }
1629 }
1630}

References dynadjust::math::matrix_2d::elementadd(), and dynadjust::math::matrix_2d::get().

Referenced by UpdateNormals_BCEKLMSVZ().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddMsrtoNormalsCoVar3()

void dynadjust::networkadjust::dna_adjust::AddMsrtoNormalsCoVar3 ( const UINT32 & design_row,
const UINT32 & stn1,
const UINT32 & stn2,
const UINT32 & stn3,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1632 of file dnaadjust.cpp.

1634{
1635 // Add covariance terms (station 1, station 2, station 3) to normal matrix
1636 for (UINT32 row, col(0); col<3; ++col)
1637 {
1638 for (row=0; row<3; ++row)
1639 {
1640 // 1-2
1641 normals->elementadd(stn1+row, stn2+col,
1642 AtVinv->get(stn1+row, design_row) * design->get(design_row, stn2+col));
1643
1644 normals->elementadd(stn2+row, stn1+col,
1645 AtVinv->get(stn2+row, design_row) * design->get(design_row, stn1+col));
1646
1647 // 1-3
1648 normals->elementadd(stn1+row, stn3+col,
1649 AtVinv->get(stn1+row, design_row) * design->get(design_row, stn3+col));
1650
1651 normals->elementadd(stn3+row, stn1+col,
1652 AtVinv->get(stn3+row, design_row) * design->get(design_row, stn1+col));
1653
1654 // 2-3
1655 normals->elementadd(stn2+row, stn3+col,
1656 AtVinv->get(stn2+row, design_row) * design->get(design_row, stn3+col));
1657
1658 normals->elementadd(stn3+row, stn2+col,
1659 AtVinv->get(stn3+row, design_row) * design->get(design_row, stn2+col));
1660 }
1661 }
1662}

References dynadjust::math::matrix_2d::elementadd(), and dynadjust::math::matrix_2d::get().

Referenced by UpdateNormals_A().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddMsrtoDesign()

void dynadjust::networkadjust::dna_adjust::AddMsrtoDesign ( const UINT32 & design_row,
const UINT32 & stn,
const double & dmdx,
const double & dmdy,
const double & dmdz,
matrix_2d * design )
inlineprivate

Definition at line 5693 of file dnaadjust.cpp.

5695{
5696 // design matrix elements for dA/dX1, dA/dY1, dA/dZ1 for 1 station
5697 AddElementtoDesign(design_row, stn, dmdx, design);
5698 AddElementtoDesign(design_row, stn+1, dmdy, design);
5699 AddElementtoDesign(design_row, stn+2, dmdz, design);
5700}
void AddElementtoDesign(const UINT32 &row, const UINT32 &col, const double value, matrix_2d *design)

References AddElementtoDesign().

Referenced by AddMsrtoDesign_BCEKMSVZ(), and AddMsrtoDesign_L().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddMsrtoDesign_L()

void dynadjust::networkadjust::dna_adjust::AddMsrtoDesign_L ( const UINT32 & design_row,
const UINT32 & stn1,
const UINT32 & stn2,
const double dmdx1,
const double dmdy1,
const double dmdz1,
const double dmdx2,
const double dmdy2,
const double dmdz2,
matrix_2d * design )
inlineprivate

Definition at line 5703 of file dnaadjust.cpp.

5706{
5707 // design matrix dA/dX1, dA/dY1, dA/dZ1
5708 AddMsrtoDesign(design_row, stn1, dmdx1, dmdy1, dmdz1, design);
5709 // design matrix dA/dX2, dA/dY2, dA/dZ2
5710 AddMsrtoDesign(design_row, stn2, dmdx2, dmdy2, dmdz2, design);
5711}
void AddMsrtoDesign(const UINT32 &design_row, const UINT32 &stn, const double &dmdx, const double &dmdy, const double &dmdz, matrix_2d *design)

References AddMsrtoDesign().

Referenced by UpdateDesignNormalMeasMatrices_L().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddMsrtoDesign_BCEKMSVZ()

void dynadjust::networkadjust::dna_adjust::AddMsrtoDesign_BCEKMSVZ ( const UINT32 & design_row,
const UINT32 & stn1,
const UINT32 & stn2,
const double dmdx,
const double dmdy,
const double dmdz,
matrix_2d * design )
inlineprivate

Definition at line 5714 of file dnaadjust.cpp.

5716{
5717 // design matrix dA/dX1, dA/dY1, dA/dZ1
5718 AddMsrtoDesign(design_row, stn1, dmdx, dmdy, dmdz, design);
5719 // design matrix dA/dX2, dA/dY2, dA/dZ2
5720 AddMsrtoDesign(design_row, stn2, -dmdx, -dmdy, -dmdz, design);
5721}

References AddMsrtoDesign().

Referenced by UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_CEM(), UpdateDesignNormalMeasMatrices_S(), UpdateDesignNormalMeasMatrices_V(), and UpdateDesignNormalMeasMatrices_Z().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddElementtoDesign()

void dynadjust::networkadjust::dna_adjust::AddElementtoDesign ( const UINT32 & row,
const UINT32 & col,
const double value,
matrix_2d * design )
inlineprivate

Definition at line 5687 of file dnaadjust.cpp.

5688{
5689 design->put(row, col, value);
5690}

References dynadjust::math::matrix_2d::put().

Referenced by AddMsrtoDesign(), UpdateDesignMeasMatrices_GX(), UpdateDesignNormalMeasMatrices_A(), UpdateDesignNormalMeasMatrices_HR(), UpdateDesignNormalMeasMatrices_IP(), UpdateDesignNormalMeasMatrices_JQ(), and UpdateDesignNormalMeasMatrices_Y().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices ( pit_vmsr_t _it_msr,
UINT32 & design_row,
bool buildnewMatrices,
const UINT32 & block,
bool MT_ReverseOrCombine )
private

Definition at line 4871 of file dnaadjust.cpp.

4872{
4873 std::stringstream ss;
4874
4875 matrix_2d* estimatedStations(&v_estimatedStations_.at(block));
4876 matrix_2d* design(&v_design_.at(block));
4877 matrix_2d* AtVinv(&v_AtVinv_.at(block));
4878 matrix_2d* measMinusComp(&v_measMinusComp_.at(block));
4879 matrix_2d* normals(&v_normals_.at(block));
4880
4881 if (MT_ReverseOrCombine)
4882 {
4883 estimatedStations = &v_estimatedStationsR_.at(block);
4884 design = &v_designR_.at(block);
4885 AtVinv = &v_AtVinvR_.at(block);
4886 measMinusComp = &v_measMinusCompR_.at(block);
4887 }
4888
4889 switch ((*_it_msr)->measType)
4890 {
4891 case 'A': // Horizontal angle
4892 UpdateDesignNormalMeasMatrices_A(_it_msr, design_row, block,
4893 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4894 break;
4895 case 'B': // Geodetic azimuth
4896 case 'K': // Astronomic azimuth
4897 // Note: UpdateDesignNormalMeasMatrices_BK reduces K measurements to the geodetic reference frame,
4898 // after which UpdateDesignNormalMeasMatrices_BK treats K measurements as B measurements upon forming
4899 // design matrix elements.
4900 UpdateDesignNormalMeasMatrices_BK(_it_msr, design_row, block,
4901 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4902 break;
4903 case 'C': // Chord dist
4904 UpdateDesignNormalMeasMatrices_C(_it_msr, design_row, block,
4905 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4906 break;
4907 case 'D': // Direction set
4908 UpdateDesignNormalMeasMatrices_D(_it_msr, design_row, block,
4909 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4910 break;
4911 case 'E': // Ellipsoid arc
4912 UpdateDesignNormalMeasMatrices_E(_it_msr, design_row, block,
4913 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4914 break;
4915 case 'G': // GPS Baseline
4916 UpdateDesignNormalMeasMatrices_G(_it_msr, design_row, block,
4917 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4918 break;
4919 case 'H': // Orthometric height
4920 // Note: UpdateDesignNormalMeasMatrices_H reduces term1 to ellipsoid height, after which
4921 // UpdateDesignNormalMeasMatrices_HR is used to form design elements.
4922 UpdateDesignNormalMeasMatrices_H(_it_msr, design_row, block,
4923 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4924 break;
4925 case 'I': // Astronomic latitude
4926 // Note: UpdateDesignNormalMeasMatrices_I reduces term1 to geodetic latitude, after which
4927 // UpdateDesignNormalMeasMatrices_IP is used to form design elements.
4928 UpdateDesignNormalMeasMatrices_I(_it_msr, design_row, block,
4929 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4930 break;
4931 case 'J': // Astronomic longitude
4932 // Note: UpdateDesignNormalMeasMatrices_J reduces term1 to geodetic longitude, after which
4933 // UpdateDesignNormalMeasMatrices_JQ is used to form design elements.
4934 UpdateDesignNormalMeasMatrices_J(_it_msr, design_row, block,
4935 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4936 break;
4937 case 'L': // Level difference
4938 UpdateDesignNormalMeasMatrices_L(_it_msr, design_row, block,
4939 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4940 break;
4941 case 'M': // MSL arc
4942 UpdateDesignNormalMeasMatrices_M(_it_msr, design_row, block,
4943 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4944 break;
4945 case 'P': // Geodetic latitude
4946 // Note: UpdateDesignNormalMeasMatrices_P archives the raw measurement, after which
4947 // UpdateDesignNormalMeasMatrices_IP is used to form design elements.
4948 UpdateDesignNormalMeasMatrices_P(_it_msr, design_row, block,
4949 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4950 break;
4951 case 'Q': // Geodetic longitude
4952 // Note: UpdateDesignNormalMeasMatrices_Q archives the raw measurement, after which
4953 // UpdateDesignNormalMeasMatrices_JQ is used to form design elements.
4954 UpdateDesignNormalMeasMatrices_Q(_it_msr, design_row, block,
4955 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4956 break;
4957 case 'R': // Ellipsoidal height
4958 // Note: UpdateDesignNormalMeasMatrices_R archives the raw measurement, after which
4959 // UpdateDesignNormalMeasMatrices_HR is used to form design elements.
4960 UpdateDesignNormalMeasMatrices_R(_it_msr, design_row, block,
4961 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4962 break;
4963 case 'S': // Slope distance
4964 UpdateDesignNormalMeasMatrices_S(_it_msr, design_row, block,
4965 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4966 break;
4967 case 'V': // Zenith distance
4968 UpdateDesignNormalMeasMatrices_V(_it_msr, design_row, block,
4969 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4970 break;
4971 case 'X': // GPS Baseline cluster
4972 UpdateDesignNormalMeasMatrices_X(_it_msr, design_row, block,
4973 measMinusComp, estimatedStations, design, AtVinv, buildnewMatrices);
4974 break;
4975 case 'Y': // GPS Point cluster
4976 UpdateDesignNormalMeasMatrices_Y(_it_msr, design_row, block,
4977 measMinusComp, estimatedStations, design, AtVinv, buildnewMatrices);
4978 break;
4979 case 'Z': // Vertical angle
4980 UpdateDesignNormalMeasMatrices_Z(_it_msr, design_row, block,
4981 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
4982 break;
4983 default:
4984 ss << "UpdateDesignNormalMeasMatrices(): Unknown measurement type - '" <<
4985 (*_it_msr)->measType << "'." << std::endl;
4986 SignalExceptionAdjustment(ss.str(), block);
4987 }
4988}
void UpdateDesignNormalMeasMatrices_R(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_M(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_BK(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_C(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_V(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_J(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_H(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_Y(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_I(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_P(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_Q(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_S(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_Z(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_A(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_X(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_D(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_L(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_G(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
void UpdateDesignNormalMeasMatrices_E(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)

References SignalExceptionAdjustment(), UpdateDesignNormalMeasMatrices_A(), UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_C(), UpdateDesignNormalMeasMatrices_D(), UpdateDesignNormalMeasMatrices_E(), UpdateDesignNormalMeasMatrices_G(), UpdateDesignNormalMeasMatrices_H(), UpdateDesignNormalMeasMatrices_I(), UpdateDesignNormalMeasMatrices_J(), UpdateDesignNormalMeasMatrices_L(), UpdateDesignNormalMeasMatrices_M(), UpdateDesignNormalMeasMatrices_P(), UpdateDesignNormalMeasMatrices_Q(), UpdateDesignNormalMeasMatrices_R(), UpdateDesignNormalMeasMatrices_S(), UpdateDesignNormalMeasMatrices_V(), UpdateDesignNormalMeasMatrices_X(), UpdateDesignNormalMeasMatrices_Y(), UpdateDesignNormalMeasMatrices_Z(), v_AtVinv_, v_AtVinvR_, v_design_, v_designR_, v_estimatedStations_, v_estimatedStationsR_, v_measMinusComp_, v_measMinusCompR_, and v_normals_.

Referenced by FillDesignNormalMeasurementsMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_A()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_A ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 5759 of file dnaadjust.cpp.

5762{
5763 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
5764 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
5765 UINT32 stn3(GetBlkMatrixElemStn3(block, _it_msr));
5766
5767 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
5768
5769 double direction12, direction13, local_12e, local_12n, local_13e, local_13n;
5770
5771 // compute angle 1 -> 2 -> 3 from estimated coordinates
5772 double comp_msr(HorizontalAngle(
5773 estimatedStations->get(stn1, 0), // X1
5774 estimatedStations->get(stn1+1, 0), // Y1
5775 estimatedStations->get(stn1+2, 0), // Z1
5776 estimatedStations->get(stn2, 0), // X2
5777 estimatedStations->get(stn2+1, 0), // Y2
5778 estimatedStations->get(stn2+2, 0), // Z2
5779 estimatedStations->get(stn3, 0), // X3
5780 estimatedStations->get(stn3+1, 0), // Y3
5781 estimatedStations->get(stn3+2, 0), // Z3
5782 stn1_it->currentLatitude,
5783 stn1_it->currentLongitude,
5784 &direction12, &direction13,
5785 &local_12e, &local_12n, &local_13e, &local_13n));
5786
5787 // Initialise measurement. No need to test if no further calculations are
5788 // required (as in stage mode), as this is done later (below)
5789 InitialiseMeasurement(_it_msr, buildnewMatrices);
5790
5791 if (buildnewMatrices)
5792 {
5793 // deflections available?
5794 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
5795 {
5796 it_vstn_t stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
5797 it_vstn_t stn3_it(bstBinaryRecords_.begin() + (*_it_msr)->station3);
5798
5800 // Angles (observed or derived from directions) must be corrected for deflection
5801 // of the vertical via "Laplace correction". This correction requires zenith
5802 // distance (zenith12, zenith13) and geodetic azimuth (direction12, direction13),
5803 // both of which must be computed from coordinates.
5804
5806 // Compute zenith distance 1 -> 2
5807 double zenith12(ZenithDistance<double>(
5808 estimatedStations->get(stn1, 0), // X1
5809 estimatedStations->get(stn1+1, 0), // Y1
5810 estimatedStations->get(stn1+2, 0), // Z1
5811 estimatedStations->get(stn2, 0), // X2
5812 estimatedStations->get(stn2+1, 0), // Y2
5813 estimatedStations->get(stn2+2, 0), // Z2
5814 stn1_it->currentLatitude,
5815 stn1_it->currentLongitude,
5816 stn2_it->currentLatitude,
5817 stn2_it->currentLongitude,
5818 (*_it_msr)->term3, // instrument height
5819 (*_it_msr)->term4)); // target height
5820
5822 // Compute zenith distance 1 -> 3
5823 double zenith13(ZenithDistance<double>(
5824 estimatedStations->get(stn1, 0), // X1
5825 estimatedStations->get(stn1+1, 0), // Y1
5826 estimatedStations->get(stn1+2, 0), // Z1
5827 estimatedStations->get(stn3, 0), // X2
5828 estimatedStations->get(stn3+1, 0), // Y2
5829 estimatedStations->get(stn3+2, 0), // Z2
5830 stn1_it->currentLatitude,
5831 stn1_it->currentLongitude,
5832 stn3_it->currentLatitude,
5833 stn3_it->currentLongitude,
5834 (*_it_msr)->term3, // instrument height
5835 (*_it_msr)->term4)); // target height
5836
5837 // Laplace correction 1 -> 2 -> 3
5838 (*_it_msr)->preAdjCorr = HzAngleDeflectionCorrection<double>(
5839 direction12, // geodetic azimuth 1 -> 2
5840 zenith12, // zenith distance 1 -> 2
5841 direction13, // geodetic azimuth 1 -> 3
5842 zenith13, // zenith distance 1 -> 3
5843 stn1_it->verticalDef, // deflection in prime vertical
5844 stn1_it->meridianDef); // deflection in prime meridian
5845
5846 (*_it_msr)->term1 -= (*_it_msr)->preAdjCorr; // apply deflection correction
5847 }
5848 else
5849 (*_it_msr)->preAdjCorr = 0.0;
5850
5851 if (projectSettings_.a.stage)
5852 return;
5853 }
5854
5855 // Update measured minus computed value
5856 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
5857
5858 double cos_lat(cos(stn1_it->currentLatitude));
5859 double sin_lat(sin(stn1_it->currentLatitude));
5860 double cos_long(cos(stn1_it->currentLongitude));
5861 double sin_long(sin(stn1_it->currentLongitude));
5862 double sinlat_coslong(sin_lat*cos_long);
5863 double sinlat_sinlong(sin_lat*sin_long);
5864 double cos2_dir12_div_n122(cos(direction12) * cos(direction12) / (local_12n * local_12n));
5865 double cos2_dir13_div_n132(cos(direction13) * cos(direction13) / (local_13n * local_13n));
5866
5867 // compute partial derivatives for normals
5868 // design matrix dA/dX1, dA/dY1, dA/dZ1
5869 AddElementtoDesign(design_row, stn1,
5870 cos2_dir13_div_n132 * (local_13n * sin_long - local_13e * sinlat_coslong) -
5871 cos2_dir12_div_n122 * (local_12n * sin_long - local_12e * sinlat_coslong),
5872 design); // X1
5873 AddElementtoDesign(design_row, stn1+1,
5874 cos2_dir13_div_n132 * (-local_13n * cos_long - local_13e * sinlat_sinlong) -
5875 cos2_dir12_div_n122 * (-local_12n * cos_long - local_12e * sinlat_sinlong),
5876 design); // Y1
5877 AddElementtoDesign(design_row, stn1+2,
5878 cos2_dir13_div_n132 * local_13e * cos_lat -
5879 cos2_dir12_div_n122 * local_12e * cos_lat, design); // Z1
5880
5881 // design matrix dA/dX2, dA/dY2, dA/dZ2
5882 AddElementtoDesign(design_row, stn2,
5883 cos2_dir12_div_n122 * (local_12n * sin_long - local_12e * sinlat_coslong),
5884 design); // X2
5885 AddElementtoDesign(design_row, stn2+1,
5886 cos2_dir12_div_n122 * (-local_12n * cos_long - local_12e * sinlat_sinlong),
5887 design); // Y2
5888 AddElementtoDesign(design_row, stn2+2,
5889 cos2_dir12_div_n122 * local_12e * cos_lat, design); // Z2
5890
5891 // design matrix dA/dX3, dA/dY3, dA/dZ3
5892 AddElementtoDesign(design_row, stn3,
5893 -cos2_dir13_div_n132 * (local_13n * sin_long - local_13e * sinlat_coslong),
5894 design); // X3
5895 AddElementtoDesign(design_row, stn3+1,
5896 -cos2_dir13_div_n132 * (-local_13n * cos_long - local_13e * sinlat_sinlong),
5897 design); // Y3
5898 AddElementtoDesign(design_row, stn3+2,
5899 -cos2_dir13_div_n132 * local_13e * cos_lat, design); // Z3
5900
5901 switch ((*_it_msr)->measType)
5902 {
5903 case 'D':
5904 // return to UpdateDesignNormalMeasMatrices_D(...)
5905 return;
5906 }
5907
5908 UpdateAtVinv(_it_msr, stn1, stn2, stn3, design_row, design, AtVinv, buildnewMatrices);
5909
5910 if (buildnewMatrices)
5911 // Add weighted measurement contributions to normal matrix
5912 UpdateNormals_A(stn1, stn2, stn3, design_row, normals, design, AtVinv);
5913 else
5914 design_row++;
5915}
void UpdateAtVinv(pit_vmsr_t _it_msr, const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, UINT32 &design_row, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices=true)
void AddMsrtoMeasMinusComp(pit_vmsr_t _it_msr, const UINT32 &design_row, const double comp_msr, matrix_2d *measMinusComp, bool printBlock=true)
UINT32 GetBlkMatrixElemStn1(const UINT32 &block, const pit_vmsr_t _it_msr)
bool InitialiseMeasurement(pit_vmsr_t _it_msr, bool buildnewMatrices)
UINT32 GetBlkMatrixElemStn2(const UINT32 &block, const pit_vmsr_t _it_msr)
UINT32 GetBlkMatrixElemStn3(const UINT32 &block, const pit_vmsr_t _it_msr)
void UpdateNormals_A(const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
const double E4_SEC_DEFLECTION(0.0001 *SEC_TO_RAD)
T ZenithDistance(const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2, const T latitude1, const T longitude1, const T latitude2, const T longitude2, const T instrumentHeight, const T targetHeight, T *local_12e, T *local_12n, T *local_12up)
T HorizontalAngle(const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2, const T X3, const T Y3, const T Z3, const T currentLatitude, const T currentLongitude, T *direction12, T *direction13, T *local_12e, T *local_12n, T *local_13e, T *local_13n)
T HzAngleDeflectionCorrection(const T azimuth12, const T zenith12, const T azimuth13, const T zenith13, const T deflPrimeV, const T deflPrimeM)
vstn_t::iterator it_vstn_t
Definition dnatypes.hpp:599
vstn_t::const_iterator it_vstn_t_const
Definition dnatypes.hpp:600

References AddElementtoDesign(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), GetBlkMatrixElemStn3(), HorizontalAngle(), HzAngleDeflectionCorrection(), InitialiseMeasurement(), projectSettings_, UpdateAtVinv(), UpdateNormals_A(), and ZenithDistance().

Referenced by UpdateDesignNormalMeasMatrices(), and UpdateDesignNormalMeasMatrices_D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_BK()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_BK ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 5918 of file dnaadjust.cpp.

5921{
5922 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
5923 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
5924
5925 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
5926 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
5927
5928 double local_12e, local_12n;
5929
5930 // compute bearing from estimated coordinates
5931 double comp_msr(Direction(
5932 estimatedStations->get(stn1, 0), // X1
5933 estimatedStations->get(stn1+1, 0), // Y1
5934 estimatedStations->get(stn1+2, 0), // Z1
5935 estimatedStations->get(stn2, 0), // X2
5936 estimatedStations->get(stn2+1, 0), // Y2
5937 estimatedStations->get(stn2+2, 0), // Z2
5938 stn1_it->currentLatitude,
5939 stn1_it->currentLongitude,
5940 &local_12e, &local_12n));
5941
5942 // Initialise measurement. No need to test if no further calculations are
5943 // required (as in stage mode), as this is done later (below)
5944 InitialiseMeasurement(_it_msr, buildnewMatrices);
5945
5946 if (buildnewMatrices)
5947 {
5948 // deflections available?
5949 if ((*_it_msr)->measType == 'K' && // Astro
5950 (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || // deflections available?
5951 fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION))
5952 {
5954 // Astronomic azimuths must be corrected for deflection of the vertical via
5955 // "Laplace correction". This correction requires zenith distance and geodetic
5956 // azimuth (comp_msr), both of which must be computed from coordinates.
5957
5959 // Compute zenith distance
5960 double zenith(ZenithDistance<double>(
5961 estimatedStations->get(stn1, 0), // X1
5962 estimatedStations->get(stn1+1, 0), // Y1
5963 estimatedStations->get(stn1+2, 0), // Z1
5964 estimatedStations->get(stn2, 0), // X2
5965 estimatedStations->get(stn2+1, 0), // Y2
5966 estimatedStations->get(stn2+2, 0), // Z2
5967 stn1_it->currentLatitude,
5968 stn1_it->currentLongitude,
5969 stn2_it->currentLatitude,
5970 stn2_it->currentLongitude,
5971 (*_it_msr)->term3, // instrument height
5972 (*_it_msr)->term4)); // target height
5973
5974 (*_it_msr)->preAdjCorr = LaplaceCorrection<double>( // Laplace correction
5975 comp_msr, // geodetic azimuth
5976 zenith, // zenith distance
5977 stn1_it->verticalDef, // deflection in prime vertical
5978 stn1_it->meridianDef, // deflection in prime meridian
5979 stn1_it->currentLatitude);
5980
5981 // scale4 must be used since term3 and term4 are station and target heights respectively
5982 (*_it_msr)->term1 -= (*_it_msr)->preAdjCorr; // apply deflection correction
5983 }
5984 else
5985 (*_it_msr)->preAdjCorr = 0.0;
5986
5987 if (projectSettings_.a.stage)
5988 return;
5989 }
5990
5991 // Update measured minus computed value
5992 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
5993
5995 // compute partial derivatives for normals
5996 double cos_lat(cos(stn1_it->currentLatitude));
5997 double sin_lat(sin(stn1_it->currentLatitude));
5998 double cos_long(cos(stn1_it->currentLongitude));
5999 double sin_long(sin(stn1_it->currentLongitude));
6000 double sinlat_coslong(sin_lat*cos_long);
6001 double sinlat_sinlong(sin_lat*sin_long);
6002 double cos2_dir12_div_n122(cos(comp_msr) * cos(comp_msr) / (local_12n * local_12n));
6003
6004 // Add partial derivatives dA/dX1, dA/dY1, dA/dZ1 to design matrix
6005 AddMsrtoDesign_BCEKMSVZ(design_row, stn1, stn2,
6006 cos2_dir12_div_n122 * (local_12n * sin_long - local_12e * sinlat_coslong),
6007 cos2_dir12_div_n122 * (-local_12n * cos_long - local_12e * sinlat_sinlong),
6008 cos2_dir12_div_n122 * local_12e * cos_lat,
6009 design);
6010
6011 // Update AtVinv based on new design matrix elements
6012 UpdateAtVinv(_it_msr, stn1, stn2, 0, design_row, design, AtVinv, buildnewMatrices);
6013
6014 if (buildnewMatrices)
6015 // Add weighted measurement contributions to normal matrix
6016 UpdateNormals_BCEKLMSVZ(stn1, stn2, design_row, normals, design, AtVinv);
6017 else
6018 design_row++;
6019}
void AddMsrtoDesign_BCEKMSVZ(const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, const double dmdx, const double dmdy, const double dmdz, matrix_2d *design)
void UpdateNormals_BCEKLMSVZ(const UINT32 &stn1, const UINT32 &stn2, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
T LaplaceCorrection(const T azimuth, const T zenith, const T deflPrimeV, const T deflPrimeM, const T Latitude)
T Direction(const T local_12e, const T local_12n)

References AddMsrtoDesign_BCEKMSVZ(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, Direction(), E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), InitialiseMeasurement(), LaplaceCorrection(), projectSettings_, UpdateAtVinv(), UpdateNormals_BCEKLMSVZ(), and ZenithDistance().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_C()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_C ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6022 of file dnaadjust.cpp.

6025{
6026 // Initialise measurement and test if no further calculations are
6027 // required (as in stage mode)
6028 if (InitialiseMeasurement(_it_msr, buildnewMatrices))
6029 return;
6030
6031 // As a C measurement is a direct vector between two points in the cartesian frame,
6032 // there will be no pre adjustment correction
6033 (*_it_msr)->preAdjCorr = 0.;
6034
6035 // Now call UpdateDesignNormalMeasMatrices_CEM
6036 UpdateDesignNormalMeasMatrices_CEM(_it_msr, design_row, block,
6037 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6038}
void UpdateDesignNormalMeasMatrices_CEM(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)

References InitialiseMeasurement(), and UpdateDesignNormalMeasMatrices_CEM().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_CEM()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_CEM ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6041 of file dnaadjust.cpp.

6044{
6045 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6046 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
6047
6048 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6049 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
6050
6051 double dX, dY, dZ;
6052
6053 // calculated distance
6054 double comp_msr(EllipsoidChordDistance<double>(
6055 estimatedStations->get(stn1, 0),
6056 estimatedStations->get(stn1+1, 0),
6057 estimatedStations->get(stn1+2, 0),
6058 estimatedStations->get(stn2, 0),
6059 estimatedStations->get(stn2+1, 0),
6060 estimatedStations->get(stn2+2, 0),
6061 stn1_it->currentLatitude,
6062 stn2_it->currentLatitude,
6063 stn1_it->currentHeight,
6064 stn2_it->currentHeight,
6065 &dX, &dY, &dZ,
6066 datum_.GetEllipsoidRef()));
6067
6068 // Update measured minus computed value
6069 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
6070
6071 // Add partial derivatives dA/dX1, dA/dY1, dA/dZ1 to design matrix
6072 AddMsrtoDesign_BCEKMSVZ(design_row, stn1, stn2,
6073 -dX/comp_msr, -dY/comp_msr, -dZ/comp_msr,
6074 design);
6075
6076 // Update AtVinv based on new design matrix elements
6077 UpdateAtVinv(_it_msr, stn1, stn2, 0, design_row, design, AtVinv, buildnewMatrices);
6078
6079 if (buildnewMatrices)
6080 // Add weighted measurement contributions to normal matrix
6081 UpdateNormals_BCEKLMSVZ(stn1, stn2, design_row, normals, design, AtVinv);
6082 else
6083 design_row++;
6084}
T EllipsoidChordDistance(const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2, const T latitude1, const T latitude2, const T Height1, const T Height2, T *dX, T *dY, T *dZ, const CDnaEllipsoid *ellipsoid)

References AddMsrtoDesign_BCEKMSVZ(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, datum_, EllipsoidChordDistance(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), UpdateAtVinv(), and UpdateNormals_BCEKLMSVZ().

Referenced by UpdateDesignNormalMeasMatrices_C(), UpdateDesignNormalMeasMatrices_E(), and UpdateDesignNormalMeasMatrices_M().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_D()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_D ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6087 of file dnaadjust.cpp.

6090{
6091 it_vmsr_t _it_msr_first(*_it_msr);
6092 UINT32 design_row_begin(design_row);
6093
6094 UINT32 a, angle_count((*_it_msr)->vectorCount2 - 1); // number of directions excluding the RO
6095 UINT32 skip(0), ignored((*_it_msr)->vectorCount1 - (*_it_msr)->vectorCount2);
6096
6097 vmsr_t angleRec;
6098 angleRec.push_back(*(*_it_msr));
6099 it_vmsr_t it_angle(angleRec.begin());
6100
6101 double previousDirection((*_it_msr)->term1);
6102
6103 (*_it_msr)++;
6104
6105 // set derived angle, variance and covariance to the binary records
6106 // term1 = measured direction
6107 // term2 = variance (direction)
6108 // term3 = instrument height (not used)
6109 // term4 = target height (not used)
6110 // scale1 = derived angle corrected for deflection of the vertical
6111 // scale2 = variance (angle)
6112 // scale3 = covariance (angle) - for the context of vmsr_t angleRec only, so as to
6113 // properly form the normals from covariances formed from directions SDs
6114 // vectorCount2 = number of non-ignored directions
6115 // preAdjMeas = original derived angle
6116
6117 if (projectSettings_.g.verbose > 6)
6118 debug_file << "Reduced angles from raw directions: ";
6119
6120 try
6121 {
6122 for (a=0; a<angle_count; ++a)
6123 {
6124 // cater for ignored directions
6125 if ((*_it_msr)->ignore)
6126 {
6127 while (skip < ignored)
6128 {
6129 skip++;
6130 (*_it_msr)++;
6131 if (!(*_it_msr)->ignore)
6132 break;
6133 }
6134 }
6135
6136 it_angle->station3 = (*_it_msr)->station2;
6137
6138 if (buildnewMatrices)
6139 {
6140 // Was this measurement reduced from previous
6141 // adjustment, which was serialised to disk?
6142 if (bms_meta_.reduced)
6143 // derived angle uncorrected for deflection of vertical
6144 it_angle->preAdjMeas = (*_it_msr)->preAdjMeas;
6145 else
6146 {
6147 // Derive the angle from two directions
6148 it_angle->term1 = (*_it_msr)->term1 - previousDirection;
6149 if (it_angle->term1 < 0)
6150 it_angle->term1 += TWO_PI;
6151 if (it_angle->term1 > TWO_PI)
6152 it_angle->term1 -= TWO_PI;
6153
6154 if (projectSettings_.g.verbose > 6)
6155 {
6156 debug_file << std::endl << "angle " <<
6157 StringFromT(RadtoDms(it_angle->term1), 6) << " = " <<
6158 StringFromT(RadtoDms((*_it_msr)->term1), 6) << " - " <<
6159 StringFromT(RadtoDms(previousDirection), 6) << std::endl;
6160 }
6161 }
6162 }
6163 else
6164 // derived angle corrected for deflection of vertical
6165 it_angle->term1 = (*_it_msr)->scale1;
6166
6167 // normals not needed
6168 UpdateDesignNormalMeasMatrices_A(&it_angle, design_row, block,
6169 measMinusComp, estimatedStations, 0, design, AtVinv, buildnewMatrices);
6170
6171 if (buildnewMatrices)
6172 {
6173 // Update derived angle, corrected for deflection of vertical
6174 (*_it_msr)->scale1 = it_angle->term1;
6175 // Update derived angle, uncorrected for deflection of vertical
6176 (*_it_msr)->preAdjMeas = it_angle->preAdjMeas;
6177 // Update correction for deflection of the vertical
6178 (*_it_msr)->preAdjCorr = it_angle->preAdjCorr;
6179 }
6180
6181 if (a + 1 == angle_count)
6182 {
6183 // check for any ignored directions
6184 if (_it_msr_first->vectorCount1 != _it_msr_first->vectorCount2)
6185 (*_it_msr) = _it_msr_first + _it_msr_first->vectorCount1;
6186 break;
6187 }
6188
6189 if (buildnewMatrices)
6190 previousDirection = (*_it_msr)->term1;
6191
6192 // prepare for next angle
6193 angleRec.push_back(*(*_it_msr));
6194 it_angle = angleRec.end() - 1;
6195
6196 (*_it_msr)++;
6197 design_row++;
6198 }
6199 }
6200 catch (...) {
6201
6202 // Print error message to adj file and throw exception
6203 std::stringstream ss;
6204 ss << "UpdateDesignNormalMeasMatrices_D(): An error was encountered whilst" << std::endl <<
6205 " updating the normal matrices" << std::endl;
6206 SignalExceptionAdjustment(ss.str(), block);
6207 }
6208
6209 // Load apriori variance matrix, and assign to binary measurement
6210 matrix_2d var_dirn(angle_count, angle_count);
6211 LoadVarianceMatrix_D(_it_msr_first, &var_dirn, buildnewMatrices);
6212
6213 if (buildnewMatrices && projectSettings_.a.stage)
6214 return;
6215
6216 UINT32 stn1, stn2, stn3;
6217 it_angle = angleRec.begin();
6218 design_row = design_row_begin;
6219
6220 // clear rows in AtVinv relating to this measurement
6221 AtVinv->zero(0, design_row, AtVinv->rows(), angle_count);
6222
6223 if (!buildnewMatrices)
6224 debug_file << "block " << block + 1 << ", design_row " << design_row + 1 << ", directions var" << var_dirn << std::endl;
6225
6226 // Update AtVinv based on new design matrix elements
6227 for (a=0; a<angle_count; ++a) // for each angle
6228 {
6229 stn1 = (v_blockStationsMap_.at(block)[it_angle->station1] * 3);
6230 stn2 = (v_blockStationsMap_.at(block)[it_angle->station2] * 3);
6231 stn3 = (v_blockStationsMap_.at(block)[it_angle->station3] * 3);
6232
6233 // Update AtVinv
6234 UpdateAtVinv_D(stn1, stn2, stn3, a, angle_count,
6235 design_row, design_row_begin,
6236 &var_dirn, design, AtVinv);
6237
6238 design_row++;
6239 it_angle++;
6240 }
6241
6242 if (buildnewMatrices)
6243 // Add weighted measurement contributions to normal matrix
6244 UpdateNormals_D(block, _it_msr_first, design_row_begin, normals, design, AtVinv);
6245}
void UpdateNormals_D(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
void UpdateAtVinv_D(const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, const UINT32 &angle, const UINT32 &angle_count, UINT32 &design_row, UINT32 &design_row_begin, matrix_2d *Vinv, matrix_2d *design, matrix_2d *AtVinv)
void LoadVarianceMatrix_D(it_vmsr_t _it_msr, matrix_2d *var_dirn, bool buildnewMatrices)
std::string StringFromT(const T &t, const int &precision=-1)
T RadtoDms(const T &dRadians)
std::vector< measurement_t > vmsr_t

References bms_meta_, debug_file, LoadVarianceMatrix_D(), projectSettings_, RadtoDms(), dynadjust::math::matrix_2d::rows(), SignalExceptionAdjustment(), StringFromT(), TWO_PI(), UpdateAtVinv_D(), UpdateDesignNormalMeasMatrices_A(), UpdateNormals_D(), v_blockStationsMap_, and dynadjust::math::matrix_2d::zero().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_E()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_E ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6247 of file dnaadjust.cpp.

6250{
6251 // Initialise measurement and test if no further calculations are
6252 // required (as in stage mode)
6253 if (InitialiseMeasurement(_it_msr, buildnewMatrices))
6254 return;
6255
6256 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6257 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
6258
6259 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6260 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
6261
6262 // Note: Each measured Ellipsoid arc is reduced to an ellipsoid chord on first run.
6263 // Whist it would be more efficient to not reduce this distance on each iteration,
6264 // the ellipsoid chord is recomputed every time using the original measurement
6265 // to cater for (potentially) large changes in latitude and longitude,
6266
6267 // Reduce Ellipsoid arc to Ellipsoid chord
6268 (*_it_msr)->term1 = EllipsoidArctoEllipsoidChord<double>(
6269 (*_it_msr)->preAdjMeas,
6270 estimatedStations->get(stn1, 0),
6271 estimatedStations->get(stn1+1, 0),
6272 estimatedStations->get(stn1+2, 0),
6273 estimatedStations->get(stn2, 0),
6274 estimatedStations->get(stn2+1, 0),
6275 estimatedStations->get(stn2+2, 0),
6276 stn1_it->currentLatitude,
6277 stn1_it->currentLongitude,
6278 stn2_it->currentLatitude,
6279 datum_.GetEllipsoidRef());
6280
6281 (*_it_msr)->preAdjCorr = (*_it_msr)->term1 - (*_it_msr)->preAdjMeas;
6282
6283 // Now that the ellipsoid arc has been reduced to a chord, call UpdateDesignNormalMeasMatrices_CEM
6284 UpdateDesignNormalMeasMatrices_CEM(_it_msr, design_row, block,
6285 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6286}
T EllipsoidArctoEllipsoidChord(const T arc, const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2, const T Latitude1, const T Longitude1, const T Latitude2, const CDnaEllipsoid *ellipsoid)

References bstBinaryRecords_, datum_, EllipsoidArctoEllipsoidChord(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), InitialiseMeasurement(), and UpdateDesignNormalMeasMatrices_CEM().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignMeasMatrices_GX()

void dynadjust::networkadjust::dna_adjust::UpdateDesignMeasMatrices_GX ( pit_vmsr_t _it_msr,
UINT32 & design_row,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * design,
const UINT32 & stn1,
const UINT32 & stn2,
bool buildnewMatrices )
private

Definition at line 6288 of file dnaadjust.cpp.

6291{
6292 // If this method is called via PrepareAdjustment() and the adjustment
6293 // mode is staged, then don't calculate measured-computed values or
6294 // fill design matrix. This will be done during an adjustment
6295 // via AdjustPhasedForward().
6296 if (buildnewMatrices && projectSettings_.a.stage)
6297 return;
6298
6299 // For all adjustment modes, when this method is called during an adjustment
6300 // to update the normals, only the the measured-computed values need to be
6301 // updated. This is because the (Jacobian) design matrix elements for GPS
6302 // are unity (1 or -1) and do not change as coordinates are updated (unlike
6303 // the Jacobian elements formed for other measurements). Hence, for all
6304 // adjustment modes except staged, the design matrix is updated once via
6305 // PrepareAdjustment. For staged adjustments, the design matrix is updated
6306 // on each iteration.
6307
6308 // Add X elements to measured minus computed
6309 AddMsrtoMeasMinusComp(_it_msr, design_row,
6310 (estimatedStations->get(stn2, 0) - estimatedStations->get(stn1, 0)),
6311 measMinusComp);
6312
6313 if (buildnewMatrices || projectSettings_.a.stage)
6314 {
6315 // Add X elements to design matrix
6316 AddElementtoDesign(design_row, stn1, -1., design); // X1
6317 AddElementtoDesign(design_row, stn2, 1., design); // X2
6318 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
6319 }
6320
6321 // move to Y element
6322 design_row++;
6323 (*_it_msr)++;
6324
6325 // Add Y elements to measured minus computed
6326 AddMsrtoMeasMinusComp(_it_msr, design_row,
6327 (estimatedStations->get(stn2+1, 0) - estimatedStations->get(stn1+1, 0)),
6328 measMinusComp, false);
6329
6330 if (buildnewMatrices || projectSettings_.a.stage)
6331 {
6332 // Add Y elements to design matrix
6333 AddElementtoDesign(design_row, stn1+1, -1., design); // Y1
6334 AddElementtoDesign(design_row, stn2+1, 1., design); // Y2
6335 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
6336 }
6337
6338 // move to Z element
6339 design_row++;
6340 (*_it_msr)++;
6341
6342 // Add Z elements to measured minus computed
6343 AddMsrtoMeasMinusComp(_it_msr, design_row,
6344 (estimatedStations->get(stn2+2, 0) - estimatedStations->get(stn1+2, 0)),
6345 measMinusComp, false);
6346
6347 if (buildnewMatrices || projectSettings_.a.stage)
6348 {
6349 // Add Z elements to design matrix
6350 AddElementtoDesign(design_row, stn1+2, -1., design); // Z1
6351 AddElementtoDesign(design_row, stn2+2, 1., design); // Z2
6352 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
6353 }
6354}

References AddElementtoDesign(), AddMsrtoMeasMinusComp(), dynadjust::math::matrix_2d::get(), and projectSettings_.

Referenced by UpdateDesignNormalMeasMatrices_G(), and UpdateDesignNormalMeasMatrices_X().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_G()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_G ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6356 of file dnaadjust.cpp.

6359{
6360 it_vmsr_t _it_msr_first(*_it_msr);
6361 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6362 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
6363 UINT32 design_row_begin(design_row);
6364
6365 UpdateDesignMeasMatrices_GX(_it_msr, design_row,
6366 measMinusComp, estimatedStations, design,
6367 stn1, stn2, buildnewMatrices);
6368
6369 // For all adjustment modes except staged, when this method is called during
6370 // an adjustment to update the normals, the weighted design matrix (AtVinv)
6371 // is not updated. This is because the (Jacobian) design matrix elements for
6372 // GPS are unity (1 or -1) and do not change as coordinates are updated (unlike
6373 // the Jacobian elements formed for other measurements). For all adjustment
6374 // modes except staged, the weighted design matrix and normals are updated once
6375 // via PrepareAdjustment. For staged adjustments, the weighted design matrix
6376 // and normals are updated on each iteration.
6377
6378
6379 // For first time run or staged adjustment mode
6380 if (buildnewMatrices || projectSettings_.a.stage)
6381 {
6382 // Load GPS Variance matrix. For the first run, scaling is applied
6383 // and the variances are written to the binary measurements list.
6384 matrix_2d var_cart(3, 3);
6385 LoadVarianceMatrix_G(_it_msr_first, &var_cart);
6386
6387 if (buildnewMatrices && projectSettings_.a.stage)
6388 return;
6389
6390 // Build At * V-1
6391 AtVinv->replace(stn1, design_row_begin, var_cart * -1);
6392 AtVinv->replace(stn2, design_row_begin, var_cart);
6393
6394 if (!projectSettings_.a.stage)
6395 // Add weighted measurement contributions to normal matrix
6396 UpdateNormals_G(stn1, stn2, design_row_begin, normals, AtVinv);
6397 }
6398
6399 design_row++;
6400}
void replace(const index_t &rowstart, const index_t &columnstart, const matrix_2d &newmat)
void UpdateNormals_G(const UINT32 &stn1, const UINT32 &stn2, UINT32 &design_row, matrix_2d *normals, matrix_2d *AtVinv)
void LoadVarianceMatrix_G(it_vmsr_t _it_msr, matrix_2d *var_cart)
void UpdateDesignMeasMatrices_GX(pit_vmsr_t _it_msr, UINT32 &design_row, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *design, const UINT32 &stn1, const UINT32 &stn2, bool buildnewMatrices)

References GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), LoadVarianceMatrix_G(), projectSettings_, dynadjust::math::matrix_2d::replace(), UpdateDesignMeasMatrices_GX(), and UpdateNormals_G().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_H()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_H ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6972 of file dnaadjust.cpp.

6975{
6976 // Initialise measurement. No need to test if no further calculations are
6977 // required (as in stage mode), as this is done later (below)
6978 InitialiseMeasurement(_it_msr, buildnewMatrices);
6979
6980 if (buildnewMatrices)
6981 {
6982 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6983
6984 // N value available?
6985 if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
6986 {
6987 // reduce to ellipsoidal height
6988 (*_it_msr)->preAdjCorr = stn1_it->geoidSep;
6989 (*_it_msr)->term1 += (*_it_msr)->preAdjCorr;
6990 }
6991
6992 if (projectSettings_.a.stage)
6993 return;
6994 }
6995
6996 UpdateDesignNormalMeasMatrices_HR(_it_msr, design_row, block,
6997 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6998}
void UpdateDesignNormalMeasMatrices_HR(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)
const double PRECISION_1E4(1.0e-4)

References bstBinaryRecords_, InitialiseMeasurement(), PRECISION_1E4(), projectSettings_, and UpdateDesignNormalMeasMatrices_HR().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_HR()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_HR ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 7001 of file dnaadjust.cpp.

7004{
7005 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
7006
7007 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
7008
7009 // Zn is the z coordinate element of the point on the z-axis
7010 // which intersects with the the normal at the given Latitude
7011 double nu1, Zn1;
7012
7013 // calculated height
7014 double comp_msr(EllipsoidHeight<double>(
7015 estimatedStations->get(stn1, 0),
7016 estimatedStations->get(stn1+1, 0),
7017 estimatedStations->get(stn1+2, 0),
7018 stn1_it->currentLatitude,
7019 &nu1, &Zn1,
7020 datum_.GetEllipsoidRef()));
7021
7022 // Add measured minus computed value
7023 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
7024
7025 // design matrix dR/dX1
7026 AddElementtoDesign(design_row, stn1, estimatedStations->get(stn1, 0)/(nu1+comp_msr), design); // X1
7027
7028 // design matrix dR/dY1
7029 AddElementtoDesign(design_row, stn1+1, estimatedStations->get(stn1+1, 0)/(nu1+comp_msr), design); // Y1
7030
7031 // design matrix dR/dZ1
7032 AddElementtoDesign(design_row, stn1+2, (estimatedStations->get(stn1+2, 0)+Zn1)/(nu1+comp_msr), design); // Z1
7033
7034 // Update AtVinv based on new design matrix elements
7035 UpdateAtVinv(_it_msr, stn1, 0, 0, design_row, design, AtVinv, buildnewMatrices);
7036
7037 if (buildnewMatrices)
7038 // Add weighted measurement contributions to normal matrix
7039 UpdateNormals_HIJPQR(stn1, design_row, normals, design, AtVinv);
7040 else
7041 design_row++;
7042}
void UpdateNormals_HIJPQR(const UINT32 &stn1, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
T EllipsoidHeight(const T X, const T Y, const T Z, const T latitude, T *nu, T *Zn, const CDnaEllipsoid *ellipsoid)

References AddElementtoDesign(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, datum_, EllipsoidHeight(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), UpdateAtVinv(), and UpdateNormals_HIJPQR().

Referenced by UpdateDesignNormalMeasMatrices_H(), and UpdateDesignNormalMeasMatrices_R().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_I()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_I ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6789 of file dnaadjust.cpp.

6792{
6793 // Initialise measurement. No need to test if no further calculations are
6794 // required (as in stage mode), as this is done later (below)
6795 InitialiseMeasurement(_it_msr, buildnewMatrices);
6796
6797 if (buildnewMatrices)
6798 {
6799 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6800
6801 // deflections available?
6802 if (fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
6803 {
6804 (*_it_msr)->preAdjCorr = stn1_it->meridianDef; // deflection in the prime meridian
6805 (*_it_msr)->term1 -= (*_it_msr)->preAdjCorr; // apply deflection correction
6806 }
6807 else
6808 (*_it_msr)->preAdjCorr = 0.0;
6809
6810 if (projectSettings_.a.stage)
6811 return;
6812 }
6813
6814 UpdateDesignNormalMeasMatrices_IP(_it_msr, design_row, block,
6815 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6816}
void UpdateDesignNormalMeasMatrices_IP(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)

References bstBinaryRecords_, E4_SEC_DEFLECTION(), InitialiseMeasurement(), projectSettings_, and UpdateDesignNormalMeasMatrices_IP().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_IP()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_IP ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6864 of file dnaadjust.cpp.

6867{
6868 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6869
6870 // Due to the lack of an explicit relationship between latitude and cartesian elements,
6871 // use mechanical differentiation.
6872 double latitude;
6873 // partial derivative for x
6874 double partialDerivative = PartialD_Latitude_F(
6875 estimatedStations->get(stn1, 0), // X1
6876 estimatedStations->get(stn1+1, 0), // Y1
6877 estimatedStations->get(stn1+2, 0), // Z1
6878 x_element, // compute for X
6879 &latitude,
6880 datum_.GetEllipsoidRef());
6881 AddElementtoDesign(design_row, stn1, partialDerivative,
6882 design); // X
6883
6884 // Update measured minus computed value
6885 AddMsrtoMeasMinusComp(_it_msr, design_row, latitude, measMinusComp);
6886
6887 // partial derivative for Y
6888 partialDerivative = PartialD_Latitude(
6889 estimatedStations->get(stn1, 0), // X1
6890 estimatedStations->get(stn1+1, 0), // Y1
6891 estimatedStations->get(stn1+2, 0), // Z1
6892 y_element, // compute for Y
6893 latitude,
6894 datum_.GetEllipsoidRef());
6895 AddElementtoDesign(design_row, stn1+1, partialDerivative,
6896 design); // Y
6897
6898 // partial derivative for Z
6899 partialDerivative = PartialD_Latitude(
6900 estimatedStations->get(stn1, 0), // X1
6901 estimatedStations->get(stn1+1, 0), // Y1
6902 estimatedStations->get(stn1+2, 0), // Z1
6903 z_element, // compute for Z
6904 latitude,
6905 datum_.GetEllipsoidRef());
6906 AddElementtoDesign(design_row, stn1+2, partialDerivative,
6907 design); // Z
6908
6909 // Update AtVinv based on new design matrix elements
6910 UpdateAtVinv(_it_msr, stn1, 0, 0, design_row, design, AtVinv, buildnewMatrices);
6911
6912 if (buildnewMatrices)
6913 // Add weighted measurement contributions to normal matrix
6914 UpdateNormals_HIJPQR(stn1, design_row, normals, design, AtVinv);
6915 else
6916 design_row++;
6917}
T PartialD_Latitude(const T &X, const T &Y, const T &Z, const _CART_ELEM_ &element, const T &latitude, const CDnaEllipsoid *ellipsoid)
T PartialD_Latitude_F(const T &X, const T &Y, const T &Z, const _CART_ELEM_ &element, T *latitude, const CDnaEllipsoid *ellipsoid)
@ y_element
Definition dnatypes.hpp:378
@ z_element
Definition dnatypes.hpp:379
@ x_element
Definition dnatypes.hpp:377

References AddElementtoDesign(), AddMsrtoMeasMinusComp(), datum_, dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), PartialD_Latitude(), PartialD_Latitude_F(), UpdateAtVinv(), UpdateNormals_HIJPQR(), x_element, y_element, and z_element.

Referenced by UpdateDesignNormalMeasMatrices_I(), and UpdateDesignNormalMeasMatrices_P().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_J()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_J ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6819 of file dnaadjust.cpp.

6822{
6823 // Initialise measurement. No need to test if no further calculations are
6824 // required (as in stage mode), as this is done later (below)
6825 InitialiseMeasurement(_it_msr, buildnewMatrices);
6826
6827 if (buildnewMatrices)
6828 {
6829 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6830
6831 // deflections available?
6832 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION)
6833 {
6834 (*_it_msr)->preAdjCorr = // deflection in the prime vertical
6835 stn1_it->verticalDef / cos(stn1_it->currentLatitude); // sec(a) = 1/cos(a)
6836 (*_it_msr)->term1 -= (*_it_msr)->preAdjCorr; // apply deflection correction
6837 }
6838 else
6839 (*_it_msr)->preAdjCorr = 0.0;
6840
6841 if (projectSettings_.a.stage)
6842 return;
6843 }
6844
6845 UpdateDesignNormalMeasMatrices_JQ(_it_msr, design_row, block,
6846 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6847}
void UpdateDesignNormalMeasMatrices_JQ(pit_vmsr_t _it_msr, UINT32 &design_row, const UINT32 &block, matrix_2d *measMinusComp, matrix_2d *estimatedStations, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv, bool buildnewMatrices)

References bstBinaryRecords_, E4_SEC_DEFLECTION(), InitialiseMeasurement(), projectSettings_, and UpdateDesignNormalMeasMatrices_JQ().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_JQ()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_JQ ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6934 of file dnaadjust.cpp.

6937{
6938 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6939
6940 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6941
6942 // Add measured minus computed value
6943 AddMsrtoMeasMinusComp(_it_msr, design_row, stn1_it->currentLongitude, measMinusComp);
6944
6945 // xy / (x^2 + y^2)^1.5
6946 double term1(estimatedStations->get(stn1, 0) * estimatedStations->get(stn1+1, 0) /
6947 pow(estimatedStations->get(stn1, 0) * estimatedStations->get(stn1, 0) +
6948 estimatedStations->get(stn1+1, 0) * estimatedStations->get(stn1+1, 0), 1.5));
6949
6950 // design matrix dlambda/dX1
6951 AddElementtoDesign(design_row, stn1, term1 * -1. / cos(stn1_it->currentLongitude), design); // X1
6952
6953 // design matrix dlambda/dY1
6954 AddElementtoDesign(design_row, stn1+1, term1 / sin(stn1_it->currentLongitude), design); // Y1
6955
6956 // design matrix dlambda/dZ1
6957 // the differentiation dlambda/dZ1 is undefined as longitude is not related
6958 // to the Z-coordinate. So use zero.
6959 AddElementtoDesign(design_row, stn1+2, 0., design); // Z1
6960
6961 // Update AtVinv based on new design matrix elements
6962 UpdateAtVinv(_it_msr, stn1, 0, 0, design_row, design, AtVinv, buildnewMatrices);
6963
6964 if (buildnewMatrices)
6965 // Add weighted measurement contributions to normal matrix
6966 UpdateNormals_HIJPQR(stn1, design_row, normals, design, AtVinv);
6967 else
6968 design_row++;
6969}

References AddElementtoDesign(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), UpdateAtVinv(), and UpdateNormals_HIJPQR().

Referenced by UpdateDesignNormalMeasMatrices_J(), and UpdateDesignNormalMeasMatrices_Q().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_L()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_L ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6720 of file dnaadjust.cpp.

6723{
6724 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6725 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
6726
6727 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6728 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
6729
6730 // Zn is the z coordinate element of the point on the z-axis
6731 // which intersects with the the normal at the given Latitude
6732 double h1, h2, nu1, nu2, Zn1, Zn2;
6733
6734 // calculated diff height
6735 double comp_msr(EllipsoidHeightDifference<double>(
6736 estimatedStations->get(stn1, 0),
6737 estimatedStations->get(stn1+1, 0),
6738 estimatedStations->get(stn1+2, 0),
6739 estimatedStations->get(stn2, 0),
6740 estimatedStations->get(stn2+1, 0),
6741 estimatedStations->get(stn2+2, 0),
6742 stn1_it->currentLatitude,
6743 stn2_it->currentLatitude,
6744 &h1, &h2, &nu1, &nu2, &Zn1, &Zn2,
6745 datum_.GetEllipsoidRef()));
6746
6747 // Initialise measurement. No need to test if no further calculations are
6748 // required (as in stage mode), as this is done later (below)
6749 InitialiseMeasurement(_it_msr, buildnewMatrices);
6750
6751 if (buildnewMatrices)
6752 {
6753 // N value available?
6754 if (fabs(stn1_it->geoidSep) > PRECISION_1E4 ||
6755 fabs(stn2_it->geoidSep) > PRECISION_1E4)
6756 {
6757 // Reduce to ellipsoidal difference
6758 (*_it_msr)->preAdjCorr = stn2_it->geoidSep - stn1_it->geoidSep;
6759 (*_it_msr)->term1 += (*_it_msr)->preAdjCorr;
6760 }
6761
6762 if (projectSettings_.a.stage)
6763 return;
6764 }
6765
6766 // Update measured minus computed value
6767 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
6768
6769 // Add partial derivatives dA/dX1, dA/dY1, dA/dZ1, dA/dX2, dA/dY2, dA/dZ2 to design matrix
6770 AddMsrtoDesign_L(design_row, stn1, stn2,
6771 -estimatedStations->get(stn1, 0)/(nu1+h1),
6772 -estimatedStations->get(stn1+1, 0)/(nu1+h1),
6773 -(estimatedStations->get(stn1+2, 0)+Zn1)/(nu1+h1),
6774 estimatedStations->get(stn2, 0)/(nu2+h2),
6775 estimatedStations->get(stn2+1, 0)/(nu2+h2),
6776 (estimatedStations->get(stn2+2, 0)+Zn2)/(nu2+h2),
6777 design);
6778
6779 // Update AtVinv based on new design matrix elements
6780 UpdateAtVinv(_it_msr, stn1, stn2, 0, design_row, design, AtVinv, buildnewMatrices);
6781
6782 if (buildnewMatrices)
6783 // Add weighted measurement contributions to normal matrix
6784 UpdateNormals_BCEKLMSVZ(stn1, stn2, design_row, normals, design, AtVinv);
6785 else
6786 design_row++;
6787}
void AddMsrtoDesign_L(const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, const double dmdx1, const double dmdy1, const double dmdz1, const double dmdx2, const double dmdy2, const double dmdz2, matrix_2d *design)
T EllipsoidHeightDifference(const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2, const T Latitude1, const T Latitude2, T *h1, T *h2, T *nu1, T *nu2, T *Zn1, T *Zn2, const CDnaEllipsoid *ellipsoid)

References AddMsrtoDesign_L(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, datum_, EllipsoidHeightDifference(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), InitialiseMeasurement(), PRECISION_1E4(), projectSettings_, UpdateAtVinv(), and UpdateNormals_BCEKLMSVZ().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_M()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_M ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6403 of file dnaadjust.cpp.

6406{
6407 // Initialise measurement and test if no further calculations are
6408 // required (as in stage mode)
6409 if (InitialiseMeasurement(_it_msr, buildnewMatrices))
6410 return;
6411
6412 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6413 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
6414
6415 // Note: Each measured MSL arc is reduced to an ellipsoid chord on the first run.
6416 // However, to cater for (potentially) large changes in latitude and longitude, recompute the
6417 // chord using the original measurement
6418
6419 // Reduce MSL arc to ellipsoid chord
6420 (*_it_msr)->term1 = MSLArctoEllipsoidChord<double>(
6421 (*_it_msr)->preAdjMeas, // use measured MSL arc
6422 stn1_it->currentLatitude, stn2_it->currentLatitude,
6423 stn1_it->geoidSep, stn2_it->geoidSep,
6424 datum_.GetEllipsoidRef());
6425
6426 (*_it_msr)->preAdjCorr = (*_it_msr)->term1 - (*_it_msr)->preAdjMeas;
6427
6428 // Now that the MSL arc has been reduced to a chord, call UpdateDesignNormalMeasMatrices_CEM
6429 UpdateDesignNormalMeasMatrices_CEM(_it_msr, design_row, block,
6430 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6431}
T MSLArctoEllipsoidChord(const T msl_arc, const T Latitude1, const T Latitude2, const T N1, const T N2, const CDnaEllipsoid *ellipsoid)

References bstBinaryRecords_, datum_, InitialiseMeasurement(), MSLArctoEllipsoidChord(), and UpdateDesignNormalMeasMatrices_CEM().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_P()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_P ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6850 of file dnaadjust.cpp.

6853{
6854 // Initialise measurement and test if no further calculations are
6855 // required (as in stage mode)
6856 if (InitialiseMeasurement(_it_msr, buildnewMatrices))
6857 return;
6858
6859 UpdateDesignNormalMeasMatrices_IP(_it_msr, design_row, block,
6860 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6861}

References InitialiseMeasurement(), and UpdateDesignNormalMeasMatrices_IP().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_Q()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_Q ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6920 of file dnaadjust.cpp.

6923{
6924 // Initialise measurement and test if no further calculations are
6925 // required (as in stage mode)
6926 if (InitialiseMeasurement(_it_msr, buildnewMatrices))
6927 return;
6928
6929 UpdateDesignNormalMeasMatrices_JQ(_it_msr, design_row, block,
6930 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
6931}

References InitialiseMeasurement(), and UpdateDesignNormalMeasMatrices_JQ().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_R()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_R ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 7045 of file dnaadjust.cpp.

7048{
7049 // Initialise measurement and test if no further calculations are
7050 // required (as in stage mode)
7051 if (InitialiseMeasurement(_it_msr, buildnewMatrices))
7052 return;
7053
7054 UpdateDesignNormalMeasMatrices_HR(_it_msr, design_row, block,
7055 measMinusComp, estimatedStations, normals, design, AtVinv, buildnewMatrices);
7056}

References InitialiseMeasurement(), and UpdateDesignNormalMeasMatrices_HR().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_S()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_S ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6440 of file dnaadjust.cpp.

6443{
6444 // preAdjMeas is used to store original measured MSL arc distance
6445 if (buildnewMatrices)
6446 {
6447 // This is the first time adjust has run, so
6448 // back up the raw measurement
6449 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
6450
6451 if (projectSettings_.a.stage)
6452 return;
6453 }
6454
6455 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6456 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
6457
6458 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6459
6460 // compute dX, dY, dZ for instrument height (ih) and target height (th)
6461 double dXih, dYih, dZih, dXth, dYth, dZth;
6462 CartesianElementsFromInstrumentHeight((*_it_msr)->term3, // instrument height
6463 &dXih, &dYih, &dZih,
6464 stn1_it->currentLatitude,
6465 stn1_it->currentLongitude);
6466 CartesianElementsFromInstrumentHeight((*_it_msr)->term4, // target height
6467 &dXth, &dYth, &dZth,
6468 stn1_it->currentLatitude,
6469 stn1_it->currentLongitude);
6470
6471 // compute distance between instrument and target, taking into consideration
6472 // instrument height, target height, and vector between stations
6473 double dX(estimatedStations->get(stn2, 0) - estimatedStations->get(stn1, 0) + dXth - dXih);
6474 double dY(estimatedStations->get(stn2+1, 0) - estimatedStations->get(stn1+1, 0) + dYth - dYih);
6475 double dZ(estimatedStations->get(stn2+2, 0) - estimatedStations->get(stn1+2, 0) + dZth - dZih);
6476
6477 // calculated distance
6478 double comp_msr(magnitude(dX, dY, dZ));
6479
6480 // Add measured minus computed value
6481 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
6482
6483 // Add partial derivatives dA/dX1, dA/dY1, dA/dZ1 to design matrix
6484 AddMsrtoDesign_BCEKMSVZ(design_row, stn1, stn2,
6485 -dX/comp_msr, -dY/comp_msr, -dZ/comp_msr,
6486 design);
6487
6488 // Update AtVinv based on new design matrix elements
6489 UpdateAtVinv(_it_msr, stn1, stn2, 0, design_row, design, AtVinv, buildnewMatrices);
6490
6491 if (buildnewMatrices)
6492 // Add weighted measurement contributions to normal matrix
6493 UpdateNormals_BCEKLMSVZ(stn1, stn2, design_row, normals, design, AtVinv);
6494 else
6495 design_row++;
6496}
T magnitude(const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2)
void CartesianElementsFromInstrumentHeight(const T height, T *dX, T *dY, T *dZ, const T Latitude, const T Longitude)

References AddMsrtoDesign_BCEKMSVZ(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, CartesianElementsFromInstrumentHeight(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), magnitude(), projectSettings_, UpdateAtVinv(), and UpdateNormals_BCEKLMSVZ().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_V()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_V ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6507 of file dnaadjust.cpp.

6510{
6511 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6512 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
6513
6514 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6515 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
6516
6517 double local_12e, local_12n, local_12up;
6518
6519 // Initialise measurement. No need to test if no further calculations are
6520 // required (as in stage mode), as this is done later (below)
6521 InitialiseMeasurement(_it_msr, buildnewMatrices);
6522
6523 if (buildnewMatrices)
6524 {
6525 // deflections available?
6526 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
6527 {
6529 // Correct for deflection of the vertical
6530 // 1. compute bearing from estimated coordinates
6531 double azimuth(Direction(
6532 estimatedStations->get(stn1, 0), // X1
6533 estimatedStations->get(stn1+1, 0), // Y1
6534 estimatedStations->get(stn1+2, 0), // Z1
6535 estimatedStations->get(stn2, 0), // X2
6536 estimatedStations->get(stn2+1, 0), // Y2
6537 estimatedStations->get(stn2+2, 0), // Z2
6538 stn1_it->currentLatitude,
6539 stn1_it->currentLongitude));
6540
6541 // 2. Compute correction
6542 (*_it_msr)->preAdjCorr = ZenithDeflectionCorrection<double>( // Correction to zenith distance for deflection of vertical
6543 azimuth, // geodetic azimuth
6544 stn1_it->verticalDef, // deflection in prime vertical
6545 stn1_it->meridianDef); // deflection in prime meridian
6546
6547 (*_it_msr)->term1 += (*_it_msr)->preAdjCorr; // apply deflection correction
6549 }
6550 else
6551 (*_it_msr)->preAdjCorr = 0.0;
6552
6553 if (projectSettings_.a.stage)
6554 return;
6555 }
6556
6557 // compute zenith distance from estimated coordinates
6558 double comp_msr(ZenithDistance(
6559 estimatedStations->get(stn1, 0), // X1
6560 estimatedStations->get(stn1+1, 0), // Y1
6561 estimatedStations->get(stn1+2, 0), // Z1
6562 estimatedStations->get(stn2, 0), // X2
6563 estimatedStations->get(stn2+1, 0), // Y2
6564 estimatedStations->get(stn2+2, 0), // Z2
6565 stn1_it->currentLatitude,
6566 stn1_it->currentLongitude,
6567 stn2_it->currentLatitude,
6568 stn2_it->currentLongitude,
6569 (*_it_msr)->term3, // instrument height
6570 (*_it_msr)->term4, // target height
6571 &local_12e, // local_12e, ..12n, ..12up represent
6572 &local_12n, // the geometric difference between
6573 &local_12up)); // station1 and station2
6574
6575 // Update measured minus computed value
6576 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
6577
6578 // compute partial derivatives for normals
6579 double e2n2(local_12e*local_12e + local_12n*local_12n);
6580 double sqrt_e2n2(sqrt(e2n2));
6581 double se2n2_up2(sqrt_e2n2/(local_12up*local_12up));
6582 double up_se2n2(local_12up*sqrt_e2n2);
6583 double cos2v(cos(comp_msr)*cos(comp_msr));
6584 double cos_lat(cos(stn1_it->currentLatitude));
6585 double sin_lat(sin(stn1_it->currentLatitude));
6586 double cos_long(cos(stn1_it->currentLongitude));
6587 double sin_long(sin(stn1_it->currentLongitude));
6588
6589 // Add partial derivatives dA/dX1, dA/dY1, dA/dZ1 to design matrix
6590 AddMsrtoDesign_BCEKMSVZ(design_row, stn1, stn2,
6591 cos2v * (((local_12e * sin_long + local_12n * sin_lat * cos_long) / up_se2n2) + cos_lat * cos_long * se2n2_up2),
6592 cos2v * (((-local_12e * cos_long + local_12n * sin_lat * sin_long) / up_se2n2) + cos_lat * sin_long * se2n2_up2),
6593 cos2v * ((-local_12n * cos_lat / up_se2n2) + sin_lat * se2n2_up2),
6594 design);
6595
6596 // Update AtVinv based on new design matrix elements
6597 UpdateAtVinv(_it_msr, stn1, stn2, 0, design_row, design, AtVinv, buildnewMatrices);
6598
6599 if (buildnewMatrices)
6600 // Add weighted measurement contributions to normal matrix
6601 UpdateNormals_BCEKLMSVZ(stn1, stn2, design_row, normals, design, AtVinv);
6602 else
6603 design_row++;
6604}
T ZenithDeflectionCorrection(const T azimuth, const T deflPrimeV, const T deflPrimeM)

References AddMsrtoDesign_BCEKMSVZ(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, Direction(), E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), InitialiseMeasurement(), projectSettings_, UpdateAtVinv(), UpdateNormals_BCEKLMSVZ(), ZenithDeflectionCorrection(), and ZenithDistance().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_X()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_X ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 7059 of file dnaadjust.cpp.

7062{
7063 it_vmsr_t _it_msr_first(*_it_msr);
7064
7065 UINT32 stn1, stn2, covr(0), covc(0);
7066
7067 UINT32 cluster_bsl, baseline_count((*_it_msr)->vectorCount1);
7068 UINT32 covariance_count;
7069 UINT32 design_row_begin(design_row);
7070
7071 for (cluster_bsl=0; cluster_bsl<baseline_count; ++cluster_bsl) // number of baselines/points
7072 {
7073 stn1 = GetBlkMatrixElemStn1(block, _it_msr);
7074 stn2 = GetBlkMatrixElemStn2(block, _it_msr);
7075
7076 UpdateDesignMeasMatrices_GX(_it_msr, design_row,
7077 measMinusComp, estimatedStations, design,
7078 stn1, stn2, buildnewMatrices);
7079
7080 design_row++;
7081
7082 covariance_count = (*_it_msr)->vectorCount2;
7083
7084 // skip covariances until next point
7085 (*_it_msr) += covariance_count * 3;
7086
7087 if (covariance_count > 0)
7088 (*_it_msr)++;
7089
7090 if (projectSettings_.g.verbose > 5)
7091 debug_file << std::endl;
7092 }
7093
7094 matrix_2d var_cart(baseline_count * 3, baseline_count * 3);
7095
7096 if (buildnewMatrices || projectSettings_.a.stage)
7097 {
7098 // Load apriori variance matrix, and assign to binary measurement
7099 // If required, apply scalars
7100 LoadVarianceMatrix_X(_it_msr_first, &var_cart);
7101
7102 if (buildnewMatrices && projectSettings_.a.stage)
7103 return;
7104 }
7105
7106 // If this method is called via PrepareAdjustment() and the adjustment
7107 // mode is staged, then don't update the AtVinv matrix. This will be
7108 // done during an adjustment via AdjustPhasedForward().
7109 if (!buildnewMatrices && !projectSettings_.a.stage)
7110 return;
7111
7112 UINT32 cluster_cov;
7113
7114 it_vmsr_t _it_msr_temp(_it_msr_first);
7115 vUINT32 baseline_stations;
7116
7117 baseline_stations.push_back(GetBlkMatrixElemStn1(block, &_it_msr_temp));
7118 baseline_stations.push_back(GetBlkMatrixElemStn2(block, &_it_msr_temp));
7119 std::sort(baseline_stations.begin(), baseline_stations.end());
7120
7121 covc = baseline_count * 3;
7122 matrix_2d tmp(3, covc);
7123
7124 // Build At * V-1
7125 for (cluster_bsl=0; cluster_bsl<baseline_count; ++cluster_bsl)
7126 {
7127 stn1 = GetBlkMatrixElemStn1(block, &_it_msr_temp);
7128 stn2 = GetBlkMatrixElemStn2(block, &_it_msr_temp);
7129
7130 // create a unique list of stations used in this cluster
7131 if (!binary_search(baseline_stations.begin(), baseline_stations.end(), stn1))
7132 {
7133 baseline_stations.push_back(stn1);
7134 std::sort(baseline_stations.begin(), baseline_stations.end());
7135 }
7136
7137 if (!binary_search(baseline_stations.begin(), baseline_stations.end(), stn2))
7138 {
7139 baseline_stations.push_back(stn2);
7140 std::sort(baseline_stations.begin(), baseline_stations.end());
7141 }
7142
7143 covr = cluster_bsl * 3;
7144 //covc = baseline_count * 3;
7145
7146 // add variances/covariances for this baseline to At * V-1
7147 //AtVinv->blockadd(stn1, design_row_begin,
7148 // var_cart.submatrix(covr,
7149 // 0, 3, covc).scale(-1.), 0, 0, 3, covc); // add entire row of this vcv
7150
7151 // copy the relevant var_cart elements to temp and multiply
7152 // by -1 to effect the design matrix elements
7153 var_cart.submatrix(covr, 0, &tmp, 3, covc);
7154 tmp.scale(-1.);
7155 // add variances/covariances for this baseline to At * V-1
7156 AtVinv->blockadd(stn1, design_row_begin,
7157 tmp, 0, 0, 3, covc); // add entire row of this vcv
7158 AtVinv->blockadd(stn2, design_row_begin,
7159 var_cart, covr, 0, 3, covc); // add entire row of this vcv
7160
7161 covariance_count = _it_msr_temp->vectorCount2;
7162 _it_msr_temp += 3; // move to covariances
7163
7164 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov)
7165 _it_msr_temp += 3;
7166 }
7167
7168 if (projectSettings_.a.stage)
7169 return;
7170
7171 _it_msr_temp = _it_msr_first;
7172
7173 matrix_2d tmp0(3, 3);
7174
7175 // Build At * V-1 * A variances
7176 for (cluster_bsl=0; cluster_bsl<baseline_count; ++cluster_bsl)
7177 {
7178 stn1 = GetBlkMatrixElemStn1(block, &_it_msr_temp);
7179 stn2 = GetBlkMatrixElemStn2(block, &_it_msr_temp);
7180
7181 covr = cluster_bsl * 3;
7182
7184 //v_normals_.at(block).blockadd(stn1, stn1, // Station 1. This variance matrix
7185 // AtVinv->submatrix(stn1, // component must be multiplied by -1 to
7186 // design_row_begin+covr, 3, 3).scale(-1.), 0, 0, 3, 3); // effect the design matrix elements
7187
7188 // copy the relevant var_cart elements to temp and multiply
7189 // by -1 to effect the design matrix elements
7190 AtVinv->submatrix(stn1, design_row_begin+covr, &tmp0, 3, 3);
7191 tmp0.scale(-1.);
7192
7193 // add variances for these stations
7194 v_normals_.at(block).blockadd(stn1, stn1, // Station 1.
7195 tmp0, 0, 0, 3, 3);
7196 v_normals_.at(block).blockadd(stn2, stn2, // Station 2
7197 v_AtVinv_.at(block), stn2, design_row_begin+covr, 3, 3);
7198
7199 covariance_count = _it_msr_temp->vectorCount2;
7200 _it_msr_temp += 3; // move to covariances
7201
7202 // add covariances for these stations
7203 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov)
7204 _it_msr_temp += 3;
7205 }
7206
7207 matrix_2d tmp1(3, baseline_count*3), tmp2(baseline_count*3, 3);
7208
7209 // Build At * V-1 * A covariances
7210 for (cluster_bsl=0; cluster_bsl<baseline_stations.size(); ++cluster_bsl)
7211 {
7212 stn1 = baseline_stations.at(cluster_bsl);
7213
7214 for (cluster_cov=0; cluster_cov<baseline_stations.size(); ++cluster_cov)
7215 {
7216 if (cluster_cov==cluster_bsl)
7217 continue;
7218
7219 stn2 = baseline_stations.at(cluster_cov);
7220
7222 //v_normals_.at(block).blockadd(stn1, stn2,
7223 // AtVinv->submatrix(stn1,
7224 // design_row_begin, 3, baseline_count*3).multiply(
7225 // design->submatrix(design_row_begin, stn2,
7226 // baseline_count*3, 3)), 0, 0, 3, 3);
7227
7228 // The following is more code, but is more efficient as it
7229 // recycles matrix instances (as opposed to creating a
7230 // new instance for every call to submatrix and multiply)
7231 // Get AtVinv component
7232 AtVinv->submatrix(stn1, design_row_begin,
7233 &tmp1, 3, baseline_count*3);
7234 // Get design component
7235 design->submatrix(design_row_begin, stn2,
7236 &tmp2, baseline_count*3, 3);
7237 // multiply the components to form covariance
7238 // for stations stn1 and stn2
7239 //tmp0.multiply(tmp1, tmp2);
7240 tmp0.multiply(tmp1, "N", tmp2, "N");
7241 // Now add covariances to normals
7242 v_normals_.at(block).blockadd(stn1, stn2,
7243 tmp0, 0, 0, 3, 3);
7244 }
7245 }
7246}
void blockadd(const index_t &row_dest, const index_t &col_dest, const matrix_2d &mat_src, const index_t &row_src, const index_t &col_src, const index_t &rows, const index_t &cols)
void submatrix(const index_t &row_begin, const index_t &col_begin, matrix_2d *dest, const index_t &rows, const index_t &columns) const
void LoadVarianceMatrix_X(it_vmsr_t _it_msr, matrix_2d *var_cart)

References dynadjust::math::matrix_2d::blockadd(), debug_file, GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), LoadVarianceMatrix_X(), dynadjust::math::matrix_2d::multiply(), projectSettings_, dynadjust::math::matrix_2d::scale(), dynadjust::math::matrix_2d::submatrix(), UpdateDesignMeasMatrices_GX(), v_AtVinv_, and v_normals_.

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_Y()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_Y ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 7249 of file dnaadjust.cpp.

7252{
7253 it_vmsr_t _it_msr_first(*_it_msr);
7254 it_vmsr_t tmp_msr;
7255
7256 UINT32 stn1, covr(0), covc(0);
7257
7258 UINT32 cluster_pnt, point_count((*_it_msr)->vectorCount1);
7259 UINT32 covariance_count;
7260 UINT32 design_row_begin(design_row);
7261
7262 // the following is required in the case when Y cluster coordinates are LLH
7263 double latitude, longitude, ellipsoidHeight, x, y, z;
7264
7265 it_vstn_t stn1_it;
7266
7267 _COORD_TYPE_ coordType(CDnaStation::GetCoordTypeC((*_it_msr)->coordType));
7268
7269 for (cluster_pnt=0; cluster_pnt<point_count; ++cluster_pnt)
7270 {
7271 covr = cluster_pnt * 3;
7272 covariance_count = (*_it_msr)->vectorCount2;
7273
7274 stn1_it = bstBinaryRecords_.begin() + (*_it_msr)->station1;
7275
7276 tmp_msr = *_it_msr;
7277
7278 stn1 = GetBlkMatrixElemStn1(block, _it_msr);
7279
7280 // Convert to cartesian reference frame?
7281 if (coordType == LLH_type_i)
7282 {
7283 // This section (and others in this function where coordType == LLH_type_i)
7284 // will only be performed once because this measurement will be converted
7285 // to XYZ and coordType will be set to XYZ_type_i
7286
7287 // Get latitude value
7288 latitude = tmp_msr->term1;
7289 // retain original value
7290 tmp_msr->preAdjMeas = tmp_msr->term1;
7291 tmp_msr++;
7292
7293 // Get longitude value
7294 longitude = tmp_msr->term1;
7295 // retain original value
7296 tmp_msr->preAdjMeas = tmp_msr->term1;
7297 tmp_msr++;
7298
7299 // Get height
7300 // NOTE: heights for Y clusters are orthometric.
7301 // Retain original value
7302 ellipsoidHeight = tmp_msr->term1;
7303 tmp_msr->preAdjMeas = tmp_msr->term1;
7304
7305 // Reduce to ellipsoid height
7306 if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
7307 {
7308 tmp_msr->preAdjCorr = stn1_it->geoidSep;
7309 ellipsoidHeight += tmp_msr->preAdjCorr;
7310 }
7311
7312 // convert
7313 GeoToCart<double>(latitude, longitude, ellipsoidHeight,
7314 &x, &y, &z,
7315 datum_.GetEllipsoidRef());
7316
7317 // Update bms record
7318 (*_it_msr)->term1 = x;
7319 snprintf((*_it_msr)->coordType, sizeof((*_it_msr)->coordType), "%s", XYZ_type);
7320
7321 // retain original reference frame
7322 (*_it_msr)->station3 = LLH_type_i;
7323 }
7324
7325 // If this method is called via PrepareAdjustment() and the adjustment
7326 // mode is staged, then don't calculate measured-computed values or
7327 // fill design matrix. This will be done during an adjustment
7328 // via AdjustPhasedForward().
7329 if (!(buildnewMatrices && projectSettings_.a.stage))
7330 {
7331 // For all adjustment modes, when this method is called during an adjustment
7332 // to update the normals, only the the measured-computed values need to be
7333 // updated. This is because the (Jacobian) design matrix elements for GPS
7334 // are unity (1 or -1) and do not change as coordinates are updated (unlike
7335 // the Jacobian elements formed for other measurements). Hence, for all
7336 // adjustment modes except staged, the design matrix is updated once via
7337 // PrepareAdjustment. For staged adjustments, the design matrix is updated
7338 // on each iteration.
7339
7340 // Add X element to measured minus computed
7341 AddMsrtoMeasMinusComp(_it_msr, design_row,
7342 estimatedStations->get(stn1, 0),
7343 measMinusComp);
7344
7345 if (buildnewMatrices || projectSettings_.a.stage)
7346 // Add X elements to design matrix
7347 AddElementtoDesign(design_row, stn1, 1., design); // X
7348
7349 design_row++;
7350 }
7351
7352 if (buildnewMatrices)
7353 if (coordType != LLH_type_i && (*_it_msr)->station3 != LLH_type_i)
7354 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
7355
7356 // move to Y element
7357 (*_it_msr)++;
7358
7359 // measurements matrix Y
7360 if (coordType == LLH_type_i)
7361 {
7362 // Update bms record
7363 (*_it_msr)->term1 = y;
7364 snprintf((*_it_msr)->coordType, sizeof((*_it_msr)->coordType), "%s", XYZ_type);
7365
7366 // retain original reference frame
7367 (*_it_msr)->station3 = LLH_type_i;
7368 }
7369
7370 // If this method is called via PrepareAdjustment() and the adjustment
7371 // mode is staged, then don't calculate measured-computed values or
7372 // fill design matrix. This will be done during an adjustment
7373 // via AdjustPhasedForward().
7374 if (!(buildnewMatrices && projectSettings_.a.stage))
7375 {
7376 // For all adjustment modes, when this method is called during an adjustment
7377 // to update the normals, only the the measured-computed values need to be
7378 // updated. This is because the (Jacobian) design matrix elements for GPS
7379 // are unity (1 or -1) and do not change as coordinates are updated (unlike
7380 // the Jacobian elements formed for other measurements). Hence, for all
7381 // adjustment modes except staged, the design matrix is updated once via
7382 // PrepareAdjustment. For staged adjustments, the design matrix is updated
7383 // on each iteration.
7384
7385 // Add Y element to measured minus computed
7386 AddMsrtoMeasMinusComp(_it_msr, design_row,
7387 estimatedStations->get(stn1+1, 0),
7388 measMinusComp, false);
7389
7390 if (buildnewMatrices || projectSettings_.a.stage)
7391 // Add Y elements to design matrix
7392 AddElementtoDesign(design_row, stn1+1, 1., design); // Y
7393
7394 design_row++;
7395 }
7396
7397 if (buildnewMatrices)
7398 if (coordType != LLH_type_i && (*_it_msr)->station3 != LLH_type_i)
7399 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
7400
7401 // move to Z element
7402 (*_it_msr)++;
7403
7404 // measurements matrix Z
7405 if (coordType == LLH_type_i)
7406 {
7407 // Update bms record
7408 (*_it_msr)->term1 = z;
7409 snprintf((*_it_msr)->coordType, sizeof((*_it_msr)->coordType), "%s", XYZ_type);
7410
7411 // retain original reference frame
7412 (*_it_msr)->station3 = LLH_type_i;
7413 }
7414
7415 // If this method is called via PrepareAdjustment() and the adjustment
7416 // mode is staged, then don't calculate measured-computed values or
7417 // fill design matrix. This will be done during an adjustment
7418 // via AdjustPhasedForward().
7419 if (!(buildnewMatrices && projectSettings_.a.stage))
7420 {
7421 // For all adjustment modes, when this method is called during an adjustment
7422 // to update the normals, only the the measured-computed values need to be
7423 // updated. This is because the (Jacobian) design matrix elements for GPS
7424 // are unity (1 or -1) and do not change as coordinates are updated (unlike
7425 // the Jacobian elements formed for other measurements). Hence, for all
7426 // adjustment modes except staged, the design matrix is updated once via
7427 // PrepareAdjustment. For staged adjustments, the design matrix is updated
7428 // on each iteration.
7429
7430 // Add Z element to measured minus computed
7431 AddMsrtoMeasMinusComp(_it_msr, design_row,
7432 estimatedStations->get(stn1+2, 0),
7433 measMinusComp, false);
7434
7435 if (buildnewMatrices || projectSettings_.a.stage)
7436 // Add Z elements to design matrix
7437 AddElementtoDesign(design_row, stn1+2, 1., design); // Z
7438
7439 design_row++;
7440 }
7441
7442 if (buildnewMatrices)
7443 if (coordType != LLH_type_i && (*_it_msr)->station3 != LLH_type_i)
7444 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
7445
7446 covariance_count = (*_it_msr)->vectorCount2;
7447
7448 // skip covariances until next point
7449 (*_it_msr) += covariance_count * 3;
7450
7451 if (covariance_count > 0)
7452 (*_it_msr)++;
7453 }
7454
7455 matrix_2d var_cart(point_count * 3, point_count * 3);
7456
7457 if (buildnewMatrices || projectSettings_.a.stage)
7458 {
7459 // Load apriori variance matrix, and assign to binary measurement
7460 // If required, propagate to cartesian reference frame and apply
7461 // scalars
7462 LoadVarianceMatrix_Y(_it_msr_first, &var_cart, coordType);
7463
7464 // If preparing for a stage adjustment, return
7465 // Normals will be built for each block as needed
7466 if (buildnewMatrices && projectSettings_.a.stage)
7467 return;
7468 }
7469
7470 // If this method is called via PrepareAdjustment() and the adjustment
7471 // mode is staged, then don't update the AtVinv matrix. This will be
7472 // done during an adjustment via AdjustPhasedForward().
7473 if (!buildnewMatrices && !projectSettings_.a.stage)
7474 return;
7475
7476 UINT32 cluster_cov;
7477
7478 UINT32 stn2, cov_c;
7479 it_vmsr_t _it_msr_temp(_it_msr_first);
7480
7481 // Build At * V-1
7482 for (cluster_pnt=0; cluster_pnt<point_count; ++cluster_pnt)
7483 {
7484 stn1 = GetBlkMatrixElemStn1(block, &_it_msr_temp);
7485 covariance_count = _it_msr_temp->vectorCount2;
7486
7487 covr = cluster_pnt * 3;
7488 covc = cluster_pnt * 3;
7489
7490 // add variance for this station
7491 AtVinv->copyelements(stn1, design_row_begin, var_cart, covr, covc, 3, 3);
7492
7493 if (covariance_count < 1)
7494 break;
7495
7496 _it_msr_temp += 3; // advance to first cluster point (if clusters exist, otherwise, next point)
7497 cov_c = 0;
7498
7499 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov) // number of baseline/point covariances
7500 {
7501 stn2 = GetBlkMatrixElemStn1(block, &_it_msr_temp); // this becomes stn1 in next cluster_pnt loop
7502
7503 covc += 3;
7504 cov_c += 3;
7505
7506 // add covariance between stn1 and this station
7507 AtVinv->copyelements(stn1, design_row_begin + cov_c, var_cart, covr, covc, 3, 3);
7508 AtVinv->copyelements(stn2, design_row_begin, var_cart, covc, covr, 3, 3);
7509
7510 _it_msr_temp += 3;
7511 }
7512
7513 design_row_begin += 3;
7514 }
7515
7516 if (projectSettings_.a.stage)
7517 return;
7518
7519 _it_msr_temp = _it_msr_first;
7520
7521 // Add to At * V-1 * A
7522 for (cluster_pnt=0; cluster_pnt<point_count; ++cluster_pnt)
7523 {
7524 stn1 = GetBlkMatrixElemStn1(block, &_it_msr_temp);
7525 covariance_count = _it_msr_temp->vectorCount2;
7526
7527 covr = cluster_pnt * 3;
7528 covc = cluster_pnt * 3;
7529
7530 // add variance for this station
7531 v_normals_.at(block).blockadd(stn1, stn1, var_cart, covr, covc, 3, 3);
7532
7533 if (covariance_count < 1)
7534 break;
7535
7536 _it_msr_temp += 3;
7537
7538 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov) // number of baseline/point covariances
7539 {
7540 stn2 = GetBlkMatrixElemStn1(block, &_it_msr_temp); // this becomes stn1 in next cluster_pnt loop
7541 covc += 3;
7542
7543 if (stn1 < stn2)
7544 {
7545 // add covariance between stn1 and this station
7546 v_normals_.at(block).blockadd(stn1, stn2, var_cart, covr, covc, 3, 3);
7547 v_normals_.at(block).blockadd(stn2, stn1, var_cart, covc, covr, 3, 3);
7548 }
7549 else
7550 {
7551 // Transpose
7552 // add covariance between stn1 and this station
7553 v_normals_.at(block).blockTadd(stn1, stn2, var_cart, covr, covc, 3, 3);
7554 v_normals_.at(block).blockTadd(stn2, stn1, var_cart, covc, covr, 3, 3);
7555 }
7556 _it_msr_temp += 3;
7557 }
7558 }
7559}
void copyelements(const index_t &row_dest, const index_t &column_dest, const matrix_2d &src, const index_t &row_src, const index_t &column_src, const index_t &rows, const index_t &columns)
static _COORD_TYPE_ GetCoordTypeC(const std::string &sType)
void LoadVarianceMatrix_Y(it_vmsr_t _it_msr, matrix_2d *var_cart, const _COORD_TYPE_ coordType)
const char *const XYZ_type("XYZ")
void GeoToCart(const T &Latitude, const T &Longitude, const T &Height, T *X, T *Y, T *Z, const CDnaEllipsoid *ellipsoid)
_COORD_TYPE_
Definition dnatypes.hpp:359
@ LLH_type_i
Definition dnatypes.hpp:362

References AddElementtoDesign(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, dynadjust::math::matrix_2d::copyelements(), datum_, GeoToCart(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), dynadjust::measurements::CDnaStation::GetCoordTypeC(), LLH_type_i, LoadVarianceMatrix_Y(), PRECISION_1E4(), projectSettings_, v_normals_, and XYZ_type().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateDesignNormalMeasMatrices_Z()

void dynadjust::networkadjust::dna_adjust::UpdateDesignNormalMeasMatrices_Z ( pit_vmsr_t _it_msr,
UINT32 & design_row,
const UINT32 & block,
matrix_2d * measMinusComp,
matrix_2d * estimatedStations,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices )
private

Definition at line 6616 of file dnaadjust.cpp.

6619{
6620 UINT32 stn1(GetBlkMatrixElemStn1(block, _it_msr));
6621 UINT32 stn2(GetBlkMatrixElemStn2(block, _it_msr));
6622
6623 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
6624 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
6625
6626 double local_12e, local_12n, local_12up;
6627
6628 // Initialise measurement. No need to test if no further calculations are
6629 // required (as in stage mode), as this is done later (below)
6630 InitialiseMeasurement(_it_msr, buildnewMatrices);
6631
6632 if (buildnewMatrices)
6633 {
6634 // deflections available?
6635 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
6636 {
6638 // Correct for deflection of the vertical
6639 // 1. compute bearing from estimated coordinates
6640 double azimuth(Direction(
6641 estimatedStations->get(stn1, 0), // X1
6642 estimatedStations->get(stn1+1, 0), // Y1
6643 estimatedStations->get(stn1+2, 0), // Z1
6644 estimatedStations->get(stn2, 0), // X2
6645 estimatedStations->get(stn2+1, 0), // Y2
6646 estimatedStations->get(stn2+2, 0), // Z2
6647 stn1_it->currentLatitude,
6648 stn1_it->currentLongitude));
6649
6650 // 2. Compute correction
6651 (*_it_msr)->preAdjCorr = ZenithDeflectionCorrection<double>( // Correction to vertical angle for deflection of vertical
6652 azimuth, // geodetic azimuth
6653 stn1_it->verticalDef, // deflection in prime vertical
6654 stn1_it->meridianDef); // deflection in prime meridian
6655
6656 (*_it_msr)->term1 -= (*_it_msr)->preAdjCorr; // apply deflection correction
6658 }
6659 else
6660 (*_it_msr)->preAdjCorr = 0.0;
6661
6662 if (projectSettings_.a.stage)
6663 return;
6664 }
6665
6666 // compute vertical angle from estimated coordinates
6667 double comp_msr(VerticalAngle(
6668 estimatedStations->get(stn1, 0), // X1
6669 estimatedStations->get(stn1+1, 0), // Y1
6670 estimatedStations->get(stn1+2, 0), // Z1
6671 estimatedStations->get(stn2, 0), // X2
6672 estimatedStations->get(stn2+1, 0), // Y2
6673 estimatedStations->get(stn2+2, 0), // Z2
6674 stn1_it->currentLatitude,
6675 stn1_it->currentLongitude,
6676 stn2_it->currentLatitude,
6677 stn2_it->currentLongitude,
6678 (*_it_msr)->term3, // instrument height
6679 (*_it_msr)->term4, // target height
6680 &local_12e, // local_12e, ..12n, ..12up represent
6681 &local_12n, // the geometric difference between
6682 &local_12up)); // station1 and station2
6683
6684 // Update measured minus computed value
6685 AddMsrtoMeasMinusComp(_it_msr, design_row, comp_msr, measMinusComp);
6686
6687 // compute partial derivative terms
6688 double e2n2(local_12e*local_12e + local_12n*local_12n);
6689 double sqrt_e2n2(sqrt(e2n2));
6690 double se2n2_d_e2n2(sqrt_e2n2/e2n2);
6691 double up_d_se2n2_e2n2(local_12up/(sqrt_e2n2*e2n2));
6692 double cos2v(cos(comp_msr)*cos(comp_msr));
6693 double cos_lat(cos(stn1_it->currentLatitude));
6694 double sin_lat(sin(stn1_it->currentLatitude));
6695 double cos_long(cos(stn1_it->currentLongitude));
6696 double sin_long(sin(stn1_it->currentLongitude));
6697
6698 // Add partial derivatives dA/dX1, dA/dY1, dA/dZ1 to design matrix
6699 AddMsrtoDesign_BCEKMSVZ(design_row, stn1, stn2,
6700 cos2v * ((-cos_lat * cos_long * se2n2_d_e2n2) - ((local_12e * sin_long + local_12n * sin_lat * cos_long) * up_d_se2n2_e2n2)),
6701 cos2v * ((-cos_lat * sin_long * se2n2_d_e2n2) + ((local_12e * cos_long - local_12n * sin_lat * sin_long) * up_d_se2n2_e2n2)),
6702 cos2v * ((-sin_lat * se2n2_d_e2n2) + (local_12n * cos_lat * up_d_se2n2_e2n2)),
6703 design);
6704
6705 // Update AtVinv based on new design matrix elements
6706 UpdateAtVinv(_it_msr, stn1, stn2, 0, design_row, design, AtVinv, buildnewMatrices);
6707
6708 if (buildnewMatrices)
6709 // Add weighted measurement contributions to normal matrix
6710 UpdateNormals_BCEKLMSVZ(stn1, stn2, design_row, normals, design, AtVinv);
6711 else
6712 design_row++;
6713}
T VerticalAngle(const T &local_12e, const T &local_12n, const T &local_12up)

References AddMsrtoDesign_BCEKMSVZ(), AddMsrtoMeasMinusComp(), bstBinaryRecords_, Direction(), E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), InitialiseMeasurement(), projectSettings_, UpdateAtVinv(), UpdateNormals_BCEKLMSVZ(), VerticalAngle(), and ZenithDeflectionCorrection().

Referenced by UpdateDesignNormalMeasMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IgnoredMeasurementContainsInvalidStation()

bool dynadjust::networkadjust::dna_adjust::IgnoredMeasurementContainsInvalidStation ( pit_vmsr_t _it_msr)
private

Definition at line 12148 of file dnaadjust.cpp.

12149{
12150 UINT32 cluster_msr, covariance_count, cluster_count((*_it_msr)->vectorCount1);
12151
12152 switch ((*_it_msr)->measType)
12153 {
12154 // Three station measurement
12155 case 'A': // Horizontal angle
12156 if (vAssocStnList_.at((*_it_msr)->station3).IsInvalid())
12157 return false;
12158 [[fallthrough]];
12159 // Two station measurements
12160 case 'B': // Geodetic azimuth
12161 case 'C': // Chord dist
12162 case 'E': // Ellipsoid arc
12163 case 'G': // GPS Baseline
12164 case 'K': // Astronomic azimuth
12165 case 'L': // Level difference
12166 case 'M': // MSL arc
12167 case 'S': // Slope distance
12168 case 'V': // Zenith distance
12169 case 'Z': // Vertical angle
12170 if (vAssocStnList_.at((*_it_msr)->station2).IsInvalid())
12171 return false;
12172 [[fallthrough]];
12173 // One station measurements
12174 case 'H': // Orthometric height
12175 case 'I': // Astronomic latitude
12176 case 'J': // Astronomic longitude
12177 case 'P': // Geodetic latitude
12178 case 'Q': // Geodetic longitude
12179 case 'R': // Ellipsoidal height
12180 if (vAssocStnList_.at((*_it_msr)->station1).IsInvalid())
12181 return false;
12182 break;
12183 // GNSS measurements
12184 case 'X': // GPS Baseline cluster
12185 case 'Y': // GPS Point cluster
12186 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
12187 {
12188 covariance_count = (*_it_msr)->vectorCount2;
12189
12190 if (vAssocStnList_.at((*_it_msr)->station1).IsInvalid())
12191 return false;
12192
12193 if ((*_it_msr)->measType == 'X')
12194 if (vAssocStnList_.at((*_it_msr)->station2).IsInvalid())
12195 return false;
12196
12197 (*_it_msr) += 2; // skip y and z
12198 (*_it_msr) += covariance_count * 3; // skip covariances
12199
12200 if (covariance_count > 0)
12201 (*_it_msr)++;
12202 }
12203 break;
12204 case 'D': // Direction set
12205 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
12206 {
12207 // Check first station
12208 if (cluster_msr == 0)
12209 if (vAssocStnList_.at((*_it_msr)->station1).IsInvalid())
12210 return false;
12211 // Check all target directions
12212 if (vAssocStnList_.at((*_it_msr)->station2).IsInvalid())
12213 return false;
12214
12215 if (cluster_msr+1 == cluster_count)
12216 break;
12217
12218 (*_it_msr)++;
12219 }
12220 break;
12221 }
12222 return true;
12223}

References vAssocStnList_.

Referenced by PrintIgnoredAdjMeasurements().

Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11897 of file dnaadjust.cpp.

11898{
11899 std::stringstream ss;
11900
11901 // Since the stations connected by an ignored measurement may appear
11902 // in different blocks, it is essential to get the correct block
11903 // number for each station. For this, use v_blockStationsMapUnique_ which
11904 // is sorted on station id.
11905 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end());
11906
11907 switch ((*_it_msr)->measType)
11908 {
11909 case 'A': // Horizontal angle
11910 UpdateIgnoredMeasurements_A(_it_msr, storeOriginalMeasurement);
11911 break;
11912 case 'B': // Geodetic azimuth
11913 UpdateIgnoredMeasurements_B(_it_msr, storeOriginalMeasurement);
11914 break;
11915 case 'C': // Chord dist
11916 UpdateIgnoredMeasurements_C(_it_msr, storeOriginalMeasurement);
11917 break;
11918 case 'D': // Direction set
11919 UpdateIgnoredMeasurements_D(_it_msr, storeOriginalMeasurement);
11920 break;
11921 case 'E': // Ellipsoid arc
11922 UpdateIgnoredMeasurements_E(_it_msr, storeOriginalMeasurement);
11923 break;
11924 case 'G': // GPS Baseline
11925 UpdateIgnoredMeasurements_G(_it_msr, storeOriginalMeasurement);
11926 break;
11927 case 'H': // Orthometric height
11928 UpdateIgnoredMeasurements_H(_it_msr, storeOriginalMeasurement);
11929 break;
11930 case 'I': // Astronomic latitude
11931 UpdateIgnoredMeasurements_I(_it_msr, storeOriginalMeasurement);
11932 break;
11933 case 'J': // Astronomic longitude
11934 UpdateIgnoredMeasurements_J(_it_msr, storeOriginalMeasurement);
11935 break;
11936 case 'K': // Astronomic azimuth
11937 UpdateIgnoredMeasurements_K(_it_msr, storeOriginalMeasurement);
11938 break;
11939 case 'L': // Level difference
11940 UpdateIgnoredMeasurements_L(_it_msr, storeOriginalMeasurement);
11941 break;
11942 case 'M': // MSL arc
11943 UpdateIgnoredMeasurements_M(_it_msr, storeOriginalMeasurement);
11944 break;
11945 case 'P': // Geodetic latitude
11946 UpdateIgnoredMeasurements_P(_it_msr, storeOriginalMeasurement);
11947 break;
11948 case 'Q': // Geodetic longitude
11949 UpdateIgnoredMeasurements_Q(_it_msr, storeOriginalMeasurement);
11950 break;
11951 case 'R': // Ellipsoidal height
11952 UpdateIgnoredMeasurements_R(_it_msr, storeOriginalMeasurement);
11953 break;
11954 case 'S': // Slope distance
11955 UpdateIgnoredMeasurements_S(_it_msr, storeOriginalMeasurement);
11956 break;
11957 case 'V': // Zenith distance
11958 UpdateIgnoredMeasurements_V(_it_msr, storeOriginalMeasurement);
11959 break;
11960 case 'X': // GPS Baseline cluster
11961 UpdateIgnoredMeasurements_X(_it_msr, storeOriginalMeasurement);
11962 break;
11963 case 'Y': // GPS Point cluster
11964 UpdateIgnoredMeasurements_Y(_it_msr, storeOriginalMeasurement);
11965 break;
11966 case 'Z': // Vertical angle
11967 UpdateIgnoredMeasurements_Z(_it_msr, storeOriginalMeasurement);
11968 break;
11969 default:
11970 ss << "UpdateIgnoredMeasurements(): Unknown measurement type - '" <<
11971 (*_it_msr)->measType << "'." << std::endl;
11972 SignalExceptionAdjustment(ss.str(), 0);
11973 }
11974}
void UpdateIgnoredMeasurements_Y(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_A(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_G(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_Z(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_K(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_X(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_C(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_I(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_B(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_E(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_V(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_J(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_L(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_P(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_Q(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_R(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_D(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_M(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_H(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)
void UpdateIgnoredMeasurements_S(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)

References SignalExceptionAdjustment(), UpdateIgnoredMeasurements_A(), UpdateIgnoredMeasurements_B(), UpdateIgnoredMeasurements_C(), UpdateIgnoredMeasurements_D(), UpdateIgnoredMeasurements_E(), UpdateIgnoredMeasurements_G(), UpdateIgnoredMeasurements_H(), UpdateIgnoredMeasurements_I(), UpdateIgnoredMeasurements_J(), UpdateIgnoredMeasurements_K(), UpdateIgnoredMeasurements_L(), UpdateIgnoredMeasurements_M(), UpdateIgnoredMeasurements_P(), UpdateIgnoredMeasurements_Q(), UpdateIgnoredMeasurements_R(), UpdateIgnoredMeasurements_S(), UpdateIgnoredMeasurements_V(), UpdateIgnoredMeasurements_X(), UpdateIgnoredMeasurements_Y(), UpdateIgnoredMeasurements_Z(), and v_blockStationsMapUnique_.

Referenced by PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_A()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_A ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 10745 of file dnaadjust.cpp.

10746{
10747 // initialise measurement (on the first adjustment only!)
10748 if (storeOriginalMeasurement)
10749 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
10750
10751 // Use v_blockStationsMapUnique_ to get the correct block for each
10752 // station in the measurement
10753 _it_pair_u32u32_uint32 it_stnmap_range;
10754 _it_u32u32_uint32_pair _it_bsmu;
10755
10756 // Get estimated station coordinates matrix and index of the
10757 // station within the matrix for station 1
10758 it_stnmap_range = equal_range(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(),
10759 (*_it_msr)->station1, CompareBlockStationMapUnique_Station<UINT32, u32u32_uint32_pair>());
10760 if (it_stnmap_range.first == it_stnmap_range.second)
10761 {
10762 //TRACE("%d not found\n", (*_it_msr)->station1);
10763 std::stringstream ss;
10764 ss << "UpdateIgnoredMeasurements(): Station " << (*_it_msr)->station1 <<
10765 " was not found in the station map." << std::endl;
10766 SignalExceptionAdjustment(ss.str(), 0);
10767 }
10768
10769 // Get the index of the station in the map
10770 _it_bsmu = it_stnmap_range.first;
10771
10772 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
10773 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
10774
10775 // Get estimated station coordinates matrix and index of the
10776 // station within the matrix for station 2
10777 it_stnmap_range = equal_range(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(),
10778 (*_it_msr)->station2, CompareBlockStationMapUnique_Station<UINT32, u32u32_uint32_pair>());
10779 if (it_stnmap_range.first == it_stnmap_range.second)
10780 {
10781 //TRACE("%d not found\n", (*_it_msr)->station2);
10782 std::stringstream ss;
10783 ss << "UpdateIgnoredMeasurements(): Station " << (*_it_msr)->station1 <<
10784 " was not found in the station map." << std::endl;
10785 SignalExceptionAdjustment(ss.str(), 0);
10786 }
10787 // Get the index of the station in the map
10788 _it_bsmu = it_stnmap_range.first;
10789
10790 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
10791 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
10792
10793 // Get estimated station coordinates matrix and index of the
10794 // station within the matrix for station 3
10795 it_stnmap_range = equal_range(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(),
10796 (*_it_msr)->station3, CompareBlockStationMapUnique_Station<UINT32, u32u32_uint32_pair>());
10797 if (it_stnmap_range.first == it_stnmap_range.second)
10798 {
10799 //TRACE("%d not found\n", (*_it_msr)->station3);
10800 std::stringstream ss;
10801 ss << "UpdateIgnoredMeasurements(): Station " << (*_it_msr)->station3 <<
10802 " was not found in the station map." << std::endl;
10803 SignalExceptionAdjustment(ss.str(), 0);
10804 }
10805
10806 // Get the index of the station in the map
10807 _it_bsmu = it_stnmap_range.first;
10808
10809 matrix_2d* estimatedStations_stn3(&v_estimatedStations_.at(_it_bsmu->second));
10810 UINT32 stn3(GetBlkMatrixElemStn3(_it_bsmu->second, _it_msr));
10811
10812 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
10813
10814 double direction12, direction13, local_12e, local_12n, local_13e, local_13n;
10815
10816 // compute angle 1 -> 2 -> 3 from estimated coordinates
10817 (*_it_msr)->measAdj = (HorizontalAngle(
10818 estimatedStations_stn1->get(stn1, 0), // X1
10819 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
10820 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
10821 estimatedStations_stn2->get(stn2, 0), // X2
10822 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
10823 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
10824 estimatedStations_stn3->get(stn3, 0), // X3
10825 estimatedStations_stn3->get(stn3 + 1, 0), // Y3
10826 estimatedStations_stn3->get(stn3 + 2, 0), // Z3
10827 stn1_it->currentLatitude,
10828 stn1_it->currentLongitude,
10829 &direction12, &direction13,
10830 &local_12e, &local_12n, &local_13e, &local_13n));
10831
10832 // deflections available?
10833 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
10834 {
10835 it_vstn_t stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
10836 it_vstn_t stn3_it(bstBinaryRecords_.begin() + (*_it_msr)->station3);
10837
10839 // Angles (observed or derived from directions) must be corrected for deflection
10840 // of the vertical via "Laplace correction". This correction requires zenith
10841 // distance (zenith12, zenith13) and geodetic azimuth (direction12, direction13),
10842 // both of which must be computed from coordinates.
10843
10845 // Compute zenith distance 1 -> 2
10846 double zenith12(ZenithDistance<double>(
10847 estimatedStations_stn1->get(stn1, 0), // X1
10848 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
10849 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
10850 estimatedStations_stn2->get(stn2, 0), // X2
10851 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
10852 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
10853 stn1_it->currentLatitude,
10854 stn1_it->currentLongitude,
10855 stn2_it->currentLatitude,
10856 stn2_it->currentLongitude,
10857 (*_it_msr)->term3, // instrument height
10858 (*_it_msr)->term4)); // target height
10859
10861 // Compute zenith distance 1 -> 3
10862 double zenith13(ZenithDistance<double>(
10863 estimatedStations_stn1->get(stn1, 0), // X1
10864 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
10865 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
10866 estimatedStations_stn3->get(stn3, 0), // X2
10867 estimatedStations_stn3->get(stn3 + 1, 0), // Y2
10868 estimatedStations_stn3->get(stn3 + 2, 0), // Z2
10869 stn1_it->currentLatitude,
10870 stn1_it->currentLongitude,
10871 stn3_it->currentLatitude,
10872 stn3_it->currentLongitude,
10873 (*_it_msr)->term3, // instrument height
10874 (*_it_msr)->term4)); // target height
10875
10876 // Laplace correction 1 -> 2 -> 3
10877 (*_it_msr)->preAdjCorr = HzAngleDeflectionCorrection<double>(
10878 direction12, // geodetic azimuth 1 -> 2
10879 zenith12, // zenith distance 1 -> 2
10880 direction13, // geodetic azimuth 1 -> 3
10881 zenith13, // zenith distance 1 -> 3
10882 stn1_it->verticalDef, // deflection in prime vertical
10883 stn1_it->meridianDef); // deflection in prime meridian
10884 }
10885 else
10886 (*_it_msr)->preAdjCorr = 0.;
10887
10888 // compute adjustment correction
10889 (*_it_msr)->measAdj += (*_it_msr)->preAdjCorr;
10890 // compute adjustment correction
10891 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
10892}
v_u32u32_uint32_pair::iterator _it_u32u32_uint32_pair
Definition dnatypes.hpp:292
std::pair< _it_u32u32_uint32_pair, _it_u32u32_uint32_pair > _it_pair_u32u32_uint32
Definition dnatypes.hpp:296

References bstBinaryRecords_, E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), GetBlkMatrixElemStn3(), HorizontalAngle(), HzAngleDeflectionCorrection(), SignalExceptionAdjustment(), v_blockStationsMapUnique_, v_estimatedStations_, and ZenithDistance().

Referenced by UpdateIgnoredMeasurements(), and UpdateIgnoredMeasurements_D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_B()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_B ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 10894 of file dnaadjust.cpp.

10895{
10896 // initialise measurement (on the first adjustment only!)
10897 if (storeOriginalMeasurement)
10898 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
10899
10900 // Compute the geodetic azimuth
10902
10903 // compute adjustment correction
10904 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
10905}
void UpdateIgnoredMeasurements_BK(pit_vmsr_t _it_msr)

References UpdateIgnoredMeasurements_BK().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_BK()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_BK ( pit_vmsr_t _it_msr)
private

Definition at line 10907 of file dnaadjust.cpp.

10908{
10909 // Use v_blockStationsMapUnique_ to get the correct block for each
10910 // station in the measurement
10911 _it_u32u32_uint32_pair _it_bsmu;
10912
10913 // Get estimated station coordinates matrix and index of the
10914 // station within the matrix for station 1
10915 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
10916 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
10917 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
10918
10919 // Get estimated station coordinates matrix and index of the
10920 // station within the matrix for station 2
10921 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
10922 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
10923 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
10924
10925 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
10926 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
10927
10928 double local_12e, local_12n;
10929
10930 // compute bearing from estimated coordinates
10931 (*_it_msr)->measAdj = (Direction(
10932 estimatedStations_stn1->get(stn1, 0), // X1
10933 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
10934 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
10935 estimatedStations_stn2->get(stn2, 0), // X2
10936 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
10937 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
10938 stn1_it->currentLatitude,
10939 stn1_it->currentLongitude,
10940 &local_12e, &local_12n));
10941}

References bstBinaryRecords_, Direction(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements_B(), and UpdateIgnoredMeasurements_K().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_C()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_C ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 10944 of file dnaadjust.cpp.

10945{
10946 // initialise measurement (on the first adjustment only!)
10947 if (storeOriginalMeasurement)
10948 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
10949
10950 // As a C measurement is a direct vector between two points in the cartesian frame,
10951 // there will be no pre adjustment correction
10952 (*_it_msr)->preAdjCorr = 0.;
10953
10954 // Compute the chord distance
10956
10957 // compute adjustment correction
10958 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
10959}
void UpdateIgnoredMeasurements_CEM(pit_vmsr_t _it_msr)

References UpdateIgnoredMeasurements_CEM().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_CEM()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_CEM ( pit_vmsr_t _it_msr)
private

Definition at line 10962 of file dnaadjust.cpp.

10963{
10964
10965 // Use v_blockStationsMapUnique_ to get the correct block for each
10966 // station in the measurement
10967 _it_u32u32_uint32_pair _it_bsmu;
10968
10969 // Get estimated station coordinates matrix and index of the
10970 // station within the matrix for station 1
10971 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
10972 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
10973 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
10974
10975 // Get estimated station coordinates matrix and index of the
10976 // station within the matrix for station 2
10977 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
10978 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
10979 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
10980
10981 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
10982 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
10983
10984 double dX, dY, dZ;
10985
10986 // calculate chord distance
10987 (*_it_msr)->measAdj = (EllipsoidChordDistance<double>(
10988 estimatedStations_stn1->get(stn1, 0),
10989 estimatedStations_stn1->get(stn1 + 1, 0),
10990 estimatedStations_stn1->get(stn1 + 2, 0),
10991 estimatedStations_stn2->get(stn2, 0),
10992 estimatedStations_stn2->get(stn2 + 1, 0),
10993 estimatedStations_stn2->get(stn2 + 2, 0),
10994 stn1_it->currentLatitude,
10995 stn2_it->currentLatitude,
10996 stn1_it->currentHeight,
10997 stn2_it->currentHeight,
10998 &dX, &dY, &dZ,
10999 datum_.GetEllipsoidRef()));
11000}

References bstBinaryRecords_, datum_, EllipsoidChordDistance(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements_C(), UpdateIgnoredMeasurements_E(), and UpdateIgnoredMeasurements_M().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_D()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_D ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11003 of file dnaadjust.cpp.

11004{
11005 it_vmsr_t _it_msr_first(*_it_msr);
11006 UINT32 a, angle_count((*_it_msr)->vectorCount1 - 1); // number of directions excluding the RO
11007
11008 vmsr_t angleRec;
11009 angleRec.push_back(*(*_it_msr));
11010 it_vmsr_t it_angle(angleRec.begin());
11011
11012 double previousDirection((*_it_msr)->term1);
11013 double previousVariance((*_it_msr)->term2);
11014
11015 (*_it_msr)++;
11016
11017 // set derived angle, variance and covariance to the binary records
11018 // term1 = measured direction
11019 // term2 = variance (direction)
11020 // term3 = instrument height (not used)
11021 // term4 = target height (not used)
11022 // scale1 = derived angle corrected for deflection of the vertical
11023 // scale2 = variance (angle)
11024 // scale3 = covariance (angle) - for the context of vmsr_t angleRec only, so as to
11025 // properly form the normals from covariances formed from directions SDs
11026 // preAdjMeas = original derived angle
11027
11028 if (projectSettings_.g.verbose > 6)
11029 debug_file << "Reduced angles from raw directions: ";
11030
11031 try
11032 {
11033 for (a=0; a<angle_count; ++a)
11034 {
11035 it_angle->station3 = (*_it_msr)->station2;
11036
11037 if (storeOriginalMeasurement)
11038 {
11039 // Derive the angle from two directions
11040 it_angle->term1 = (*_it_msr)->term1 - previousDirection;
11041 if (it_angle->term1 < 0)
11042 it_angle->term1 += TWO_PI;
11043 if (it_angle->term1 > TWO_PI)
11044 it_angle->term1 -= TWO_PI;
11045 // Derive the variance of the angle
11046 (*_it_msr)->scale2 = previousVariance + (*_it_msr)->term2;
11047 }
11048 else
11049 it_angle->preAdjMeas = (*_it_msr)->scale1;
11050
11051 UpdateIgnoredMeasurements_A(&it_angle, storeOriginalMeasurement);
11052
11053 // apply correction for deflections in the vertical
11054 (*_it_msr)->scale1 = it_angle->preAdjMeas;
11055 // compute adjustment correction
11056 (*_it_msr)->measCorr = it_angle->measCorr;
11057 // Update correction for deflection of the vertical
11058 (*_it_msr)->preAdjCorr = it_angle->preAdjCorr;
11059
11060 if (a + 1 == angle_count)
11061 break;
11062
11063 if (storeOriginalMeasurement)
11064 {
11065 previousDirection = (*_it_msr)->term1;
11066 previousVariance = (*_it_msr)->term2;
11067 }
11068
11069 // prepare for next angle
11070 angleRec.push_back(*(*_it_msr));
11071 it_angle = angleRec.end() - 1;
11072
11073 (*_it_msr)++;
11074 }
11075
11076 }
11077 catch (...) {
11078
11079 // Print error message to adj file and throw exception
11080 std::stringstream ss;
11081 ss << "UpdateIgnoredMeasurements_D(): An error was encountered whilst" << std::endl <<
11082 " calculating ignored measurement details" << std::endl;
11083 SignalExceptionAdjustment(ss.str(), 0);
11084 }
11085
11086}

References debug_file, projectSettings_, SignalExceptionAdjustment(), TWO_PI(), and UpdateIgnoredMeasurements_A().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_E()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_E ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11089 of file dnaadjust.cpp.

11090{
11091 // initialise measurement (on the first adjustment only!)
11092 if (storeOriginalMeasurement)
11093 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11094
11095 // Compute the chord distance
11097
11098 // Use v_blockStationsMapUnique_ to get the correct block for each
11099 // station in the measurement
11100 _it_u32u32_uint32_pair _it_bsmu;
11101
11102 // Get estimated station coordinates matrix and index of the
11103 // station within the matrix for station 1
11104 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11105 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
11106 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11107
11108 // Get estimated station coordinates matrix and index of the
11109 // station within the matrix for station 2
11110 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
11111 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
11112 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
11113
11114 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11115 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
11116
11117 // Compute Ellipsoid arc from Ellipsoid chord
11118 double ellipsoid_arc = EllipsoidChordtoEllipsoidArc<double>(
11119 (*_it_msr)->measAdj, // use Ellipsoid chord computed by UpdateIgnoredMeasurements_CEM
11120 estimatedStations_stn1->get(stn1, 0),
11121 estimatedStations_stn1->get(stn1 + 1, 0),
11122 estimatedStations_stn1->get(stn1 + 2, 0),
11123 estimatedStations_stn2->get(stn2, 0),
11124 estimatedStations_stn2->get(stn2 + 1, 0),
11125 estimatedStations_stn2->get(stn2 + 2, 0),
11126 stn1_it->currentLatitude,
11127 stn1_it->currentLongitude,
11128 stn2_it->currentLatitude,
11129 datum_.GetEllipsoidRef());
11130
11131 // compute correction from arc to chord
11132 (*_it_msr)->preAdjCorr = ellipsoid_arc - (*_it_msr)->measAdj;
11133 // update adjusted measurement
11134 (*_it_msr)->measAdj = ellipsoid_arc;
11135 // compute adjustment correction
11136 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11137}
T EllipsoidChordtoEllipsoidArc(const T chord, const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2, const T Latitude1, const T Longitude1, const T Latitude2, const CDnaEllipsoid *ellipsoid)

References bstBinaryRecords_, datum_, EllipsoidChordtoEllipsoidArc(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), UpdateIgnoredMeasurements_CEM(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_G()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_G ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11140 of file dnaadjust.cpp.

11141{
11142 UpdateIgnoredMeasurements_GX(_it_msr, storeOriginalMeasurement);
11143}
void UpdateIgnoredMeasurements_GX(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)

References UpdateIgnoredMeasurements_GX().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_GX()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_GX ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11145 of file dnaadjust.cpp.

11146{
11147 // Use v_blockStationsMapUnique_ to get the correct block for each
11148 // station in the measurement
11149 _it_u32u32_uint32_pair _it_bsmu;
11150
11151 // Get estimated station coordinates matrix and index of the
11152 // station within the matrix for station 1
11153 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11154 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
11155 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11156
11157 // Get estimated station coordinates matrix and index of the
11158 // station within the matrix for station 2
11159 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
11160 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
11161 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
11162
11163 // initialise measurement (on the first adjustment only!)
11164 if (storeOriginalMeasurement)
11165 // X element
11166 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11167 // update adjusted measurement
11168 (*_it_msr)->measAdj = (estimatedStations_stn2->get(stn2, 0) - estimatedStations_stn1->get(stn1, 0));
11169 // compute adjustment correction
11170 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11171
11172 // move to Y element
11173 (*_it_msr)++;
11174 if (storeOriginalMeasurement)
11175 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11176 // update adjusted measurement
11177 (*_it_msr)->measAdj = (estimatedStations_stn2->get(stn2+1, 0) - estimatedStations_stn1->get(stn1+1, 0));
11178 // compute adjustment correction
11179 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11180
11181 // move to Z element
11182 (*_it_msr)++;
11183 if (storeOriginalMeasurement)
11184 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11185 // update adjusted measurement
11186 (*_it_msr)->measAdj = (estimatedStations_stn2->get(stn2+2, 0) - estimatedStations_stn1->get(stn1+2, 0));
11187 // compute adjustment correction
11188 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11189}

References dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements_G(), and UpdateIgnoredMeasurements_X().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_H()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_H ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11192 of file dnaadjust.cpp.

11193{
11194 // initialise measurement (on the first adjustment only!)
11195 if (storeOriginalMeasurement)
11196 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11197
11198 // Compute the ellipsoid height
11200
11201 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11202
11203 // N value available?
11204 if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
11205 {
11206 // get ellipsoid - geoid separation
11207 (*_it_msr)->preAdjCorr = stn1_it->geoidSep;
11208 }
11209 else
11210 (*_it_msr)->preAdjCorr = 0.;
11211
11212 (*_it_msr)->measAdj -= (*_it_msr)->preAdjCorr;
11213 // compute adjustment correction
11214 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11215}
void UpdateIgnoredMeasurements_HR(pit_vmsr_t _it_msr)

References bstBinaryRecords_, PRECISION_1E4(), and UpdateIgnoredMeasurements_HR().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_HR()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_HR ( pit_vmsr_t _it_msr)
private

Definition at line 11218 of file dnaadjust.cpp.

11219{
11220 // Use v_blockStationsMapUnique_ to get the correct block for each
11221 // station in the measurement
11222 _it_u32u32_uint32_pair _it_bsmu;
11223
11224 // Get estimated station coordinates matrix and index of the
11225 // station within the matrix for station 1
11226 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11227 matrix_2d* estimatedStations(&v_estimatedStations_.at(_it_bsmu->second));
11228 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11229
11230 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11231
11232 // Zn is the z coordinate element of the point on the z-axis
11233 // which intersects with the the normal at the given Latitude
11234 double nu1, Zn1;
11235
11236 // compute the ellipsoid height height
11237 (*_it_msr)->measAdj = (EllipsoidHeight<double>(
11238 estimatedStations->get(stn1, 0),
11239 estimatedStations->get(stn1 + 1, 0),
11240 estimatedStations->get(stn1 + 2, 0),
11241 stn1_it->currentLatitude,
11242 &nu1, &Zn1,
11243 datum_.GetEllipsoidRef()));
11244}

References bstBinaryRecords_, datum_, EllipsoidHeight(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements_H(), and UpdateIgnoredMeasurements_R().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_I()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_I ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11247 of file dnaadjust.cpp.

11248{
11249 // initialise measurement (on the first adjustment only!)
11250 if (storeOriginalMeasurement)
11251 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11252
11253 // calculate geodetic latitude
11255
11256 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11257
11258 // deflections available?
11259 if (fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
11260 // deflection in the prime meridian
11261 (*_it_msr)->preAdjCorr = stn1_it->meridianDef;
11262 else
11263 (*_it_msr)->preAdjCorr = 0.;
11264
11265 // apply deflection correction
11266 (*_it_msr)->measAdj += (*_it_msr)->preAdjCorr;
11267 // compute adjustment correction
11268 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11269}
void UpdateIgnoredMeasurements_IP(pit_vmsr_t _it_msr)

References bstBinaryRecords_, E4_SEC_DEFLECTION(), and UpdateIgnoredMeasurements_IP().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_IP()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_IP ( pit_vmsr_t _it_msr)
private

Definition at line 11272 of file dnaadjust.cpp.

11273{
11274 // Use v_blockStationsMapUnique_ to get the correct block for each
11275 // station in the measurement
11276 _it_u32u32_uint32_pair _it_bsmu;
11277
11278 // Get estimated station coordinates matrix and index of the
11279 // station within the matrix for station 1
11280 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11281 matrix_2d* estimatedStations(&v_estimatedStations_.at(_it_bsmu->second));
11282 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11283
11284 // compute the geodetic latitude
11285 (*_it_msr)->measAdj = (CartToLat<double>(
11286 estimatedStations->get(stn1, 0), // X1
11287 estimatedStations->get(stn1 + 1, 0), // Y1
11288 estimatedStations->get(stn1 + 2, 0), // Z1
11289 datum_.GetEllipsoidRef()));
11290}
T CartToLat(const T &X, const T &Y, const T &Z, const CDnaEllipsoid *ellipsoid)

References CartToLat(), datum_, dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements_I(), and UpdateIgnoredMeasurements_P().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_J()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_J ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11293 of file dnaadjust.cpp.

11294{
11295 // initialise measurement (on the first adjustment only!)
11296 if (storeOriginalMeasurement)
11297 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11298
11299 // calculate geodetic longitude
11301
11302 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11303
11304 // deflections available?
11305 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION)
11306 // deflection in the prime vertical
11307 (*_it_msr)->preAdjCorr =
11308 stn1_it->verticalDef / cos(stn1_it->currentLatitude); // sec(a) = 1/cos(a)
11309 else
11310 (*_it_msr)->preAdjCorr = 0.;
11311
11312 // apply deflection correction
11313 (*_it_msr)->measAdj += (*_it_msr)->preAdjCorr;
11314 // compute adjustment correction
11315 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11316
11317}
void UpdateIgnoredMeasurements_JQ(pit_vmsr_t _it_msr)

References bstBinaryRecords_, E4_SEC_DEFLECTION(), and UpdateIgnoredMeasurements_JQ().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_JQ()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_JQ ( pit_vmsr_t _it_msr)
private

Definition at line 11320 of file dnaadjust.cpp.

11321{
11322 // Use v_blockStationsMapUnique_ to get the correct block for each
11323 // station in the measurement
11324 _it_u32u32_uint32_pair _it_bsmu;
11325
11326 // Get estimated station coordinates matrix and index of the
11327 // station within the matrix for station 1
11328 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11329 matrix_2d* estimatedStations(&v_estimatedStations_.at(_it_bsmu->second));
11330 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11331
11332 double latitude, longitude, ellipsoidHeight;
11333
11334 // compute the geodetic longitude
11336 estimatedStations->get(stn1, 0), // X1
11337 estimatedStations->get(stn1 + 1, 0), // Y1
11338 estimatedStations->get(stn1 + 2, 0), // Z1
11339 &latitude,
11340 &longitude,
11341 &ellipsoidHeight,
11342 datum_.GetEllipsoidRef());
11343
11344 (*_it_msr)->measAdj = longitude;
11345}
void CartToGeo(const T &X, const T &Y, const T &Z, T *latitude, T *longitude, T *height, const CDnaEllipsoid *ellipsoid)

References CartToGeo(), datum_, dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements_J(), and UpdateIgnoredMeasurements_Q().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_K()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_K ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11347 of file dnaadjust.cpp.

11348{
11349 // initialise measurement (on the first adjustment only!)
11350 if (storeOriginalMeasurement)
11351 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11352
11353 // Compute the geodetic azimuth
11355
11356 // Use v_blockStationsMapUnique_ to get the correct block for each
11357 // station in the measurement
11358 _it_u32u32_uint32_pair _it_bsmu;
11359
11360 // Get estimated station coordinates matrix and index of the
11361 // station within the matrix for station 1
11362 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11363 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
11364 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11365
11366 // Get estimated station coordinates matrix and index of the
11367 // station within the matrix for station 2
11368 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
11369 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
11370 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
11371
11372 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11373 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
11374
11375 // deflections available?
11376 if ((*_it_msr)->measType == 'K' && // Astro
11377 (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || // deflections available?
11378 fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION))
11379 {
11381 // Astronomic azimuths must be corrected for deflection of the vertical via
11382 // "Laplace correction". This correction requires zenith distance and geodetic
11383 // azimuth (comp_msr), both of which must be computed from coordinates.
11384
11386 // Compute zenith distance
11387 double zenith(ZenithDistance<double>(
11388 estimatedStations_stn1->get(stn1, 0), // X1
11389 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
11390 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
11391 estimatedStations_stn2->get(stn2, 0), // X2
11392 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
11393 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
11394 stn1_it->currentLatitude,
11395 stn1_it->currentLongitude,
11396 stn2_it->currentLatitude,
11397 stn2_it->currentLongitude,
11398 (*_it_msr)->term3, // instrument height
11399 (*_it_msr)->term4)); // target height
11400
11401 // Compute pre adjustment correction
11402 (*_it_msr)->preAdjCorr = LaplaceCorrection<double>( // Laplace correction
11403 (*_it_msr)->measAdj, // geodetic azimuth
11404 zenith, // zenith distance
11405 stn1_it->verticalDef, // deflection in prime vertical
11406 stn1_it->meridianDef, // deflection in prime meridian
11407 stn1_it->currentLatitude);
11408 }
11409 else
11410 (*_it_msr)->preAdjCorr = 0.;
11411
11412 // apply correction for deflections in the vertical
11413 (*_it_msr)->measAdj += (*_it_msr)->preAdjCorr;
11414 // compute adjustment correction
11415 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11416}

References bstBinaryRecords_, E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), LaplaceCorrection(), UpdateIgnoredMeasurements_BK(), v_blockStationsMapUnique_, v_estimatedStations_, and ZenithDistance().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_L()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_L ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11418 of file dnaadjust.cpp.

11419{
11420 // initialise measurement (on the first adjustment only!)
11421 if (storeOriginalMeasurement)
11422 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11423
11424 // Use v_blockStationsMapUnique_ to get the correct block for each
11425 // station in the measurement
11426 _it_u32u32_uint32_pair _it_bsmu;
11427
11428 // Get estimated station coordinates matrix and index of the
11429 // station within the matrix for station 1
11430 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11431 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
11432 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11433
11434 // Get estimated station coordinates matrix and index of the
11435 // station within the matrix for station 2
11436 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
11437 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
11438 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
11439
11440 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11441 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
11442
11443 // Zn is the z coordinate element of the point on the z-axis
11444 // which intersects with the the normal at the given Latitude
11445 double h1, h2, nu1, nu2, Zn1, Zn2;
11446
11447 // calculated diff height
11448 (*_it_msr)->measAdj = (EllipsoidHeightDifference<double>(
11449 estimatedStations_stn1->get(stn1, 0),
11450 estimatedStations_stn1->get(stn1 + 1, 0),
11451 estimatedStations_stn1->get(stn1 + 2, 0),
11452 estimatedStations_stn2->get(stn2, 0),
11453 estimatedStations_stn2->get(stn2 + 1, 0),
11454 estimatedStations_stn2->get(stn2 + 2, 0),
11455 stn1_it->currentLatitude,
11456 stn2_it->currentLatitude,
11457 &h1, &h2, &nu1, &nu2, &Zn1, &Zn2,
11458 datum_.GetEllipsoidRef()));
11459
11460 // N value available?
11461 if (fabs(stn1_it->geoidSep) > PRECISION_1E4 ||
11462 fabs(stn2_it->geoidSep) > PRECISION_1E4)
11463 // Compute ellipsoid-geoid separation correction
11464 (*_it_msr)->preAdjCorr = stn2_it->geoidSep - stn1_it->geoidSep;
11465 else
11466 (*_it_msr)->preAdjCorr = 0.;
11467
11468 // apply the ellipsoid-geoid separation correction
11469 (*_it_msr)->measAdj -= (*_it_msr)->preAdjCorr;
11470 // compute adjustment correction
11471 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11472}

References bstBinaryRecords_, datum_, EllipsoidHeightDifference(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), PRECISION_1E4(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_M()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_M ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11475 of file dnaadjust.cpp.

11476{
11477 // initialise measurement (on the first adjustment only!)
11478 if (storeOriginalMeasurement)
11479 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11480
11481 // Compute the chord distance
11483
11484 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11485 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
11486
11487 // Compute MSL arc from Ellipsoid chord
11488 double msl_arc = EllipsoidChordtoMSLArc<double>(
11489 (*_it_msr)->measAdj, // use Ellipsoid chord computed by UpdateIgnoredMeasurements_CEM
11490 stn1_it->currentLatitude, stn2_it->currentLatitude,
11491 stn1_it->geoidSep, stn2_it->geoidSep,
11492 datum_.GetEllipsoidRef());
11493
11494 // compute correction from arc to chord
11495 (*_it_msr)->preAdjCorr = msl_arc - (*_it_msr)->measAdj;
11496 // update adjusted measurement
11497 (*_it_msr)->measAdj = msl_arc;
11498 // compute adjustment correction
11499 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11500}
T EllipsoidChordtoMSLArc(const T ellipsoid_chord, const T Latitude1, const T Latitude2, const T N1, const T N2, const CDnaEllipsoid *ellipsoid)

References bstBinaryRecords_, datum_, EllipsoidChordtoMSLArc(), and UpdateIgnoredMeasurements_CEM().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_P()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_P ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11503 of file dnaadjust.cpp.

11504{
11505 // initialise measurement (on the first adjustment only!)
11506 if (storeOriginalMeasurement)
11507 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11508
11510
11511 // As a P measurement is the result of a direct conversion of cartesian coordinates,
11512 // there will be no pre adjustment correction
11513 (*_it_msr)->preAdjCorr = 0.;
11514 // compute adjustment correction
11515 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11516}

References UpdateIgnoredMeasurements_IP().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_Q()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_Q ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11519 of file dnaadjust.cpp.

11520{
11521 // initialise measurement (on the first adjustment only!)
11522 if (storeOriginalMeasurement)
11523 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11524
11526
11527 // As a Q measurement is the result of a direct conversion of cartesian coordinates,
11528 // there will be no pre adjustment correction
11529 (*_it_msr)->preAdjCorr = 0.;
11530 // compute adjustment correction
11531 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11532}

References UpdateIgnoredMeasurements_JQ().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_R()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_R ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11535 of file dnaadjust.cpp.

11536{
11537 // initialise measurement (on the first adjustment only!)
11538 if (storeOriginalMeasurement)
11539 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11540
11542
11543 // As a R measurement is the result of a direct conversion of cartesian coordinates,
11544 // there will be no pre adjustment correction
11545 (*_it_msr)->preAdjCorr = 0.;
11546 // compute adjustment correction
11547 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11548}

References UpdateIgnoredMeasurements_HR().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_S()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_S ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11551 of file dnaadjust.cpp.

11552{
11553 // initialise measurement (on the first adjustment only!)
11554 if (storeOriginalMeasurement)
11555 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11556
11557 // Use v_blockStationsMapUnique_ to get the correct block for each
11558 // station in the measurement
11559 _it_pair_u32u32_uint32 it_stnmap_range;
11560 _it_u32u32_uint32_pair _it_bsmu;
11561
11562 // Get estimated station coordinates matrix and index of the
11563 // station within the matrix for station 1
11564 it_stnmap_range = equal_range(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(),
11565 (*_it_msr)->station1, CompareBlockStationMapUnique_Station<UINT32, u32u32_uint32_pair>());
11566 if (it_stnmap_range.first == it_stnmap_range.second)
11567 {
11568 //TRACE("%d not found\n", (*_it_msr)->station1);
11569 std::stringstream ss;
11570 ss << "UpdateIgnoredMeasurements(): Station " << (*_it_msr)->station1 <<
11571 " was not found in the station map." << std::endl;
11572 SignalExceptionAdjustment(ss.str(), 0);
11573 }
11574
11575 // Get the index of the station in the map
11576 _it_bsmu = it_stnmap_range.first;
11577
11578 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
11579 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11580
11581 // Get estimated station coordinates matrix and index of the
11582 // station within the matrix for station 2
11583 it_stnmap_range = equal_range(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(),
11584 (*_it_msr)->station2, CompareBlockStationMapUnique_Station<UINT32, u32u32_uint32_pair>());
11585 if (it_stnmap_range.first == it_stnmap_range.second)
11586 {
11587 //TRACE("%d not found\n", (*_it_msr)->station2);
11588 std::stringstream ss;
11589 ss << "UpdateIgnoredMeasurements(): Station " << (*_it_msr)->station2 <<
11590 " was not found in the station map." << std::endl;
11591 SignalExceptionAdjustment(ss.str(), 0);
11592 }
11593
11594 // Get the index of the station in the map
11595 _it_bsmu = it_stnmap_range.first;
11596
11597 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
11598 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
11599
11600 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11601
11602 // compute dX, dY, dZ for instrument height (ih) and target height (th)
11603 double dXih, dYih, dZih, dXth, dYth, dZth;
11604 CartesianElementsFromInstrumentHeight((*_it_msr)->term3, // instrument height
11605 &dXih, &dYih, &dZih,
11606 stn1_it->currentLatitude,
11607 stn1_it->currentLongitude);
11608 CartesianElementsFromInstrumentHeight((*_it_msr)->term4, // target height
11609 &dXth, &dYth, &dZth,
11610 stn1_it->currentLatitude,
11611 stn1_it->currentLongitude);
11612
11613 // compute distance between instrument and target, taking into consideration
11614 // instrument height, target height, and vector between stations
11615 double dX(estimatedStations_stn2->get(stn2, 0) - estimatedStations_stn1->get(stn1, 0) + dXth - dXih);
11616 double dY(estimatedStations_stn2->get(stn2 + 1, 0) - estimatedStations_stn1->get(stn1 + 1, 0) + dYth - dYih);
11617 double dZ(estimatedStations_stn2->get(stn2 + 2, 0) - estimatedStations_stn1->get(stn1 + 2, 0) + dZth - dZih);
11618
11619 // calculated distance
11620 (*_it_msr)->measAdj = (magnitude(dX, dY, dZ));
11621 // As an S measurement is the result of a direct computation from cartesian coordinates,
11622 // there will be no pre adjustment correction
11623 (*_it_msr)->preAdjCorr = 0.;
11624 // compute adjustment correction
11625 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11626}

References bstBinaryRecords_, CartesianElementsFromInstrumentHeight(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), magnitude(), SignalExceptionAdjustment(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_V()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_V ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11630 of file dnaadjust.cpp.

11631{
11632 // initialise measurement (on the first adjustment only!)
11633 if (storeOriginalMeasurement)
11634 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11635
11636 // Use v_blockStationsMapUnique_ to get the correct block for each
11637 // station in the measurement
11638 _it_u32u32_uint32_pair _it_bsmu;
11639
11640 // Get estimated station coordinates matrix and index of the
11641 // station within the matrix for station 1
11642 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11643 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
11644 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11645
11646 // Get estimated station coordinates matrix and index of the
11647 // station within the matrix for station 2
11648 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
11649 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
11650 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
11651
11652 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11653 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
11654
11655 double local_12e, local_12n, local_12up;
11656
11657 // compute zenith distance from estimated coordinates
11658 (*_it_msr)->measAdj = (ZenithDistance(
11659 estimatedStations_stn1->get(stn1, 0), // X1
11660 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
11661 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
11662 estimatedStations_stn2->get(stn2, 0), // X2
11663 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
11664 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
11665 stn1_it->currentLatitude,
11666 stn1_it->currentLongitude,
11667 stn2_it->currentLatitude,
11668 stn2_it->currentLongitude,
11669 (*_it_msr)->term3, // instrument height
11670 (*_it_msr)->term4, // target height
11671 &local_12e, // local_12e, ..12n, ..12up represent
11672 &local_12n, // the geometric difference between
11673 &local_12up)); // station1 and station2
11674
11675 // deflections available?
11676 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
11677 {
11679 // Correct for deflections in the vertical
11680 // 1. compute bearing from estimated coordinates
11681 double azimuth(Direction(
11682 estimatedStations_stn1->get(stn1, 0), // X1
11683 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
11684 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
11685 estimatedStations_stn2->get(stn2, 0), // X2
11686 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
11687 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
11688 stn1_it->currentLatitude,
11689 stn1_it->currentLongitude));
11690
11691 // 2. Compute correction
11692 (*_it_msr)->preAdjCorr = ZenithDeflectionCorrection<double>( // Correction to vertical angle for deflection of vertical
11693 azimuth, // geodetic azimuth
11694 stn1_it->verticalDef, // deflection in prime vertical
11695 stn1_it->meridianDef); // deflection in prime meridian
11697 }
11698 else
11699 (*_it_msr)->preAdjCorr = 0.;
11700
11701 // apply correction for deflections in the vertical
11702 (*_it_msr)->measAdj -= (*_it_msr)->preAdjCorr;
11703 // compute adjustment correction
11704 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11705}

References bstBinaryRecords_, Direction(), E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), v_blockStationsMapUnique_, v_estimatedStations_, ZenithDeflectionCorrection(), and ZenithDistance().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_X()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_X ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11708 of file dnaadjust.cpp.

11709{
11710 UINT32 cluster_bsl, baseline_count((*_it_msr)->vectorCount1);
11711 UINT32 covariance_count;
11712
11713 for (cluster_bsl = 0; cluster_bsl < baseline_count; ++cluster_bsl) // number of baselines/points
11714 {
11715 UpdateIgnoredMeasurements_GX(_it_msr, storeOriginalMeasurement);
11716
11717 covariance_count = (*_it_msr)->vectorCount2;
11718
11719 // skip covariances until next point
11720 (*_it_msr) += covariance_count * 3;
11721
11722 if (covariance_count > 0)
11723 (*_it_msr)++;
11724 }
11725}

References UpdateIgnoredMeasurements_GX().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_Y()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_Y ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11728 of file dnaadjust.cpp.

11729{
11730 // Use v_blockStationsMapUnique_ to get the correct block for each
11731 // station in the measurement
11732 _it_u32u32_uint32_pair _it_bsmu;
11733
11734 // Get estimated station coordinates matrix and index of the
11735 // station within the matrix for station 1. Since Y clusters are
11736 // correlated measurements which are never split, all stations will
11737 // be in the same block as station 1.
11738 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11739 matrix_2d* estimatedStations(&v_estimatedStations_.at(_it_bsmu->second));
11740
11741 UINT32 stn1;
11742 UINT32 cluster_pnt, point_count((*_it_msr)->vectorCount1);
11743 UINT32 covariance_count;
11744 it_vstn_t stn1_it;
11745 double latitude, longitude, height, x, y, z;
11746
11747 _COORD_TYPE_ coordType(CDnaStation::GetCoordTypeC((*_it_msr)->coordType));
11748
11749 for (cluster_pnt = 0; cluster_pnt < point_count; ++cluster_pnt)
11750 {
11751 covariance_count = (*_it_msr)->vectorCount2;
11752
11753 stn1_it = bstBinaryRecords_.begin() + (*_it_msr)->station1;
11754
11755 stn1 = GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr);
11756
11757 // Get latest cartesian coordinates
11758 x = estimatedStations->get(stn1, 0);
11759 y = estimatedStations->get(stn1 + 1, 0);
11760 z = estimatedStations->get(stn1 + 2, 0);
11761
11762 // initialise measurement (on the first adjustment only!)
11763 if (storeOriginalMeasurement)
11764 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11765
11766 // Convert to geographic coordinates?
11767 if (coordType == LLH_type_i)
11768 {
11769 CartToGeo<double>(x, y, z, &latitude, &longitude, &height, datum_.GetEllipsoidRef());
11770 (*_it_msr)->measAdj = latitude;
11771 }
11772 else
11773 (*_it_msr)->measAdj = x;
11774
11775 // move to Y element
11776 (*_it_msr)++;
11777 // initialise measurement (on the first adjustment only!)
11778 if (storeOriginalMeasurement)
11779 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11780
11781 if (coordType == LLH_type_i)
11782 (*_it_msr)->measAdj = longitude;
11783 else
11784 (*_it_msr)->measAdj = y;
11785
11786 // move to Z element
11787 (*_it_msr)++;
11788 // initialise measurement (on the first adjustment only!)
11789 if (storeOriginalMeasurement)
11790 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11791
11792 if (coordType == LLH_type_i)
11793 {
11794 // Reduce to ellipsoid height?
11795 if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
11796 {
11797 (*_it_msr)->preAdjCorr = stn1_it->geoidSep;
11798 (*_it_msr)->term1 += (*_it_msr)->preAdjCorr;
11799 }
11800
11801 (*_it_msr)->measAdj = height;
11802 }
11803 else
11804 (*_it_msr)->measAdj = z;
11805
11806 covariance_count = (*_it_msr)->vectorCount2;
11807
11808 // skip covariances until next point
11809 (*_it_msr) += covariance_count * 3;
11810
11811 if (covariance_count > 0)
11812 (*_it_msr)++;
11813 }
11814}

References bstBinaryRecords_, CartToGeo(), datum_, dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), dynadjust::measurements::CDnaStation::GetCoordTypeC(), LLH_type_i, PRECISION_1E4(), v_blockStationsMapUnique_, and v_estimatedStations_.

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateIgnoredMeasurements_Z()

void dynadjust::networkadjust::dna_adjust::UpdateIgnoredMeasurements_Z ( pit_vmsr_t _it_msr,
bool storeOriginalMeasurement )
private

Definition at line 11819 of file dnaadjust.cpp.

11820{
11821 // initialise measurement (on the first adjustment only!)
11822 if (storeOriginalMeasurement)
11823 (*_it_msr)->preAdjMeas = (*_it_msr)->term1;
11824
11825 // Use v_blockStationsMapUnique_ to get the correct block for each
11826 // station in the measurement
11827 _it_u32u32_uint32_pair _it_bsmu;
11828
11829 // Get estimated station coordinates matrix and index of the
11830 // station within the matrix for station 1
11831 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station1;
11832 matrix_2d* estimatedStations_stn1(&v_estimatedStations_.at(_it_bsmu->second));
11833 UINT32 stn1(GetBlkMatrixElemStn1(_it_bsmu->second, _it_msr));
11834
11835 // Get estimated station coordinates matrix and index of the
11836 // station within the matrix for station 2
11837 _it_bsmu = v_blockStationsMapUnique_.begin() + (*_it_msr)->station2;
11838 matrix_2d* estimatedStations_stn2(&v_estimatedStations_.at(_it_bsmu->second));
11839 UINT32 stn2(GetBlkMatrixElemStn2(_it_bsmu->second, _it_msr));
11840
11841 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + (*_it_msr)->station1);
11842 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + (*_it_msr)->station2);
11843
11844 double local_12e, local_12n, local_12up;
11845
11846 // compute vertical angle from estimated coordinates
11847 (*_it_msr)->measAdj = (VerticalAngle(
11848 estimatedStations_stn1->get(stn1, 0), // X1
11849 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
11850 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
11851 estimatedStations_stn2->get(stn2, 0), // X2
11852 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
11853 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
11854 stn1_it->currentLatitude,
11855 stn1_it->currentLongitude,
11856 stn2_it->currentLatitude,
11857 stn2_it->currentLongitude,
11858 (*_it_msr)->term3, // instrument height
11859 (*_it_msr)->term4, // target height
11860 &local_12e, // local_12e, ..12n, ..12up represent
11861 &local_12n, // the geometric difference between
11862 &local_12up)); // station1 and station2
11863
11864 // deflections available?
11865 if (fabs(stn1_it->verticalDef) > E4_SEC_DEFLECTION || fabs(stn1_it->meridianDef) > E4_SEC_DEFLECTION)
11866 {
11868 // Correct for deflection of the vertical
11869 // 1. compute bearing from estimated coordinates
11870 double azimuth(Direction(
11871 estimatedStations_stn1->get(stn1, 0), // X1
11872 estimatedStations_stn1->get(stn1 + 1, 0), // Y1
11873 estimatedStations_stn1->get(stn1 + 2, 0), // Z1
11874 estimatedStations_stn2->get(stn2, 0), // X2
11875 estimatedStations_stn2->get(stn2 + 1, 0), // Y2
11876 estimatedStations_stn2->get(stn2 + 2, 0), // Z2
11877 stn1_it->currentLatitude,
11878 stn1_it->currentLongitude));
11879
11880 // 2. Compute correction
11881 (*_it_msr)->preAdjCorr = ZenithDeflectionCorrection<double>( // Correction to vertical angle for deflection of vertical
11882 azimuth, // geodetic azimuth
11883 stn1_it->verticalDef, // deflection in prime vertical
11884 stn1_it->meridianDef); // deflection in prime meridian
11886 }
11887 else
11888 (*_it_msr)->preAdjCorr = 0.;
11889
11890 // apply deflection correction
11891 (*_it_msr)->measAdj += (*_it_msr)->preAdjCorr;
11892 // compute adjustment correction
11893 (*_it_msr)->measCorr = (*_it_msr)->measAdj - (*_it_msr)->preAdjMeas;
11894}

References bstBinaryRecords_, Direction(), E4_SEC_DEFLECTION(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), v_blockStationsMapUnique_, v_estimatedStations_, VerticalAngle(), and ZenithDeflectionCorrection().

Referenced by UpdateIgnoredMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadVarianceScaling()

void dynadjust::networkadjust::dna_adjust::LoadVarianceScaling ( it_vmsr_t _it_msr,
double & vScale,
double & pScale,
double & lScale,
double & hScale,
bool & scaleMatrix,
bool & scalePartial )
private

Definition at line 5459 of file dnaadjust.cpp.

5462{
5463 vScale = _it_msr->scale4;
5464
5465 // trap vscale equal to very small numbers or zero
5466 if (vScale < minVal(PRECISION_1E5, projectSettings_.a.fixed_std_dev))
5467 vScale = 1.0;
5468
5469 // non zero matrix scalar?
5470 scaleMatrix = (fabs(vScale - 1.0) > PRECISION_1E5);
5471
5472 // partial matrix scalars
5473 pScale = _it_msr->scale1;
5474 lScale = _it_msr->scale2;
5475 hScale = _it_msr->scale3;
5476
5477 // trap vscale equal to very small numbers or zero
5478 if (pScale < minVal(PRECISION_1E5, projectSettings_.a.fixed_std_dev))
5479 pScale = 1.0;
5480 if (lScale < minVal(PRECISION_1E5, projectSettings_.a.fixed_std_dev))
5481 lScale = 1.0;
5482 if (hScale < minVal(PRECISION_1E5, projectSettings_.a.fixed_std_dev))
5483 hScale = 1.0;
5484
5485 if (fabs(pScale - 1.0) > PRECISION_1E5 || fabs(lScale - 1.0) > PRECISION_1E5 || fabs(hScale - 1.0) > PRECISION_1E5)
5486 scalePartial = true;
5487 else
5488 scalePartial = false;
5489
5490 if (scalePartial && scaleMatrix)
5491 {
5492 // partial matrix scalars
5493 pScale *= vScale;
5494 lScale *= vScale;
5495 hScale *= vScale;
5496 }
5497}
const double PRECISION_1E5(1.0e-5)
T minVal(const T &lhs, const U &rhs)

References minVal(), PRECISION_1E5(), and projectSettings_.

Referenced by LoadVarianceMatrix_G(), LoadVarianceMatrix_X(), and LoadVarianceMatrix_Y().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadVarianceMatrix_D()

void dynadjust::networkadjust::dna_adjust::LoadVarianceMatrix_D ( it_vmsr_t _it_msr,
matrix_2d * var_dirn,
bool buildnewMatrices )
private

Definition at line 5065 of file dnaadjust.cpp.

5066{
5067 // load the correlated angles variance matrix from the binary file
5068 if (bms_meta_.reduced || !buildnewMatrices)
5069 {
5070 try {
5071 // load as-is, assuming that an adjustment has been run
5072 // and the variances have been reduced (scaled)
5073 GetDirectionsVarianceMatrix(_it_msr, var_dirn);
5074 FormInverseVarianceMatrix(var_dirn, true);
5075 return;
5076 }
5077 catch (const std::runtime_error& e) {
5078
5079 // Print error message to adj file and throw exception
5080 std::stringstream ss;
5081 PrintMsrVarianceMatrixException(_it_msr, e, ss, "LoadVarianceMatrix_D");
5082 SignalExceptionAdjustment(ss.str(), 0);
5083 }
5084 }
5085
5086 // OK, create the correlated angles variance matrix from the binary
5087 // file
5088
5089 it_vmsr_t _it_msr_first(_it_msr);
5090
5091 // angle, variance and covariance set in the binary records as follows:
5092 // term1 = direction
5093 // term2 = variance (direction)
5094 // term3 = instrument height (leave as-is)
5095 // term4 = target height (leave as-is)
5096 // scale1 = derived angle corrected for deflection of the vertical
5097 // scale2 = variance (angle)
5098 // scale3 = covariance (angle)
5099 // vectorCount2 = number of non-ignored directions
5100 // preAdjMeas = original derived angle
5101
5102 UINT32 a, angle_count(_it_msr->vectorCount2 - 1); // number of directions excluding the RO
5103
5104 matrix_2d A(angle_count, _it_msr->vectorCount2);
5105 matrix_2d AV(angle_count, _it_msr->vectorCount2);
5106
5107 var_dirn->redim(angle_count, angle_count);
5108 var_dirn->zero();
5109
5110 double previousVariance(_it_msr->term2);
5111 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
5112
5113 if (projectSettings_.g.verbose > 5)
5114 debug_file << std::endl << "Std dev " << std::scientific << std::setprecision(16) << _it_msr->term2 << " (" << std::fixed << std::setprecision(2) << Seconds(sqrt(_it_msr->term2)) << " seconds)" << std::endl;
5115
5116 _it_msr++;
5117
5118 // propagate (uncorrelated) directions variances to angles variances
5119 try {
5120 for (a=0; a<angle_count; ++a)
5121 {
5122 // cater for ignored directions
5123 if (_it_msr->ignore)
5124 {
5125 while (skip < ignored)
5126 {
5127 skip++;
5128 _it_msr++;
5129 if (!_it_msr->ignore)
5130 break;
5131 }
5132 }
5133
5134 // Fill design & variance matrices to propagate variances from directions to angles
5135 A.put(a, a, -1);
5136 A.put(a, a+1, 1);
5137 AV.put(a, a, previousVariance * -1);
5138 AV.put(a, a+1, _it_msr->term2);
5139
5140 if (projectSettings_.g.verbose > 5)
5141 debug_file << "Std dev " << std::scientific << std::setprecision(16) << _it_msr->term2 << " (" << std::fixed << std::setprecision(2) << Seconds(sqrt(_it_msr->term2)) << " seconds)" << std::endl;
5142
5143 if (a+1 == angle_count)
5144 break;
5145
5146 previousVariance = _it_msr->term2;
5147 _it_msr++;
5148 }
5149
5150 if (projectSettings_.g.verbose > 6)
5151 {
5152 debug_file << std::endl << "Directions variance matrix:" << std::endl;
5153 debug_file << "A " << A << std::endl;
5154 debug_file << "AV " << std::scientific << std::setprecision(16) << AV << std::endl;
5155 }
5156
5157 // AVAT for correlated angles will not be a fully populated matrix, but a
5158 // banded one whereby correlations exist only for angles adjacent to each other.
5159 // So, propagate manually.
5160 UINT32 d;
5161 for (a=0; a<angle_count; ++a)
5162 {
5163 // variances
5164 for (d=0; d<2; ++d)
5165 var_dirn->elementadd(a, a, AV.get(a, a+d) * A.get(a, a+d));
5166 if (a+1 == angle_count)
5167 break;
5168 // covariances
5169 var_dirn->elementadd(a, a+1, AV.get(a, a+1) * A.get(a+1, a+1));
5170 var_dirn->elementadd(a+1, a, var_dirn->get(a, a+1));
5171 }
5172
5173 // Now the variance matrix has been formed, set the variances and
5174 // covariances to the binary file
5175 SetDirectionsVarianceMatrix(_it_msr_first, *var_dirn);
5176
5177 if (projectSettings_.g.verbose > 5)
5178 debug_file << "V.dxyz " << std::scientific << std::setprecision(16) << std::setw(26) << *var_dirn;
5179
5180 // Form inverse
5181 FormInverseVarianceMatrix(var_dirn);
5182 }
5183 catch (const std::runtime_error& e) {
5184
5185 // Print error message to adj file and throw exception
5186 std::stringstream ss;
5187 PrintMsrVarianceMatrixException(_it_msr_first, e, ss, "LoadVarianceMatrix_D");
5188 SignalExceptionAdjustment(ss.str(), 0);
5189 }
5190
5191 if (projectSettings_.g.verbose > 5)
5192 debug_file << "Inv V.dxyz " << std::scientific << std::setprecision(16) << std::setw(26) << *var_dirn;
5193
5194}
void redim(const index_t &rows, const index_t &columns)
void PrintMsrVarianceMatrixException(const it_vmsr_t &_it_msr, const std::runtime_error &e, std::stringstream &ss, const std::string &calling_function, const UINT32 msr_count=0)
T Seconds(const T &radians)
void GetDirectionsVarianceMatrix(msr_t_Iterator begin, matrix_2d *vmat)
void SetDirectionsVarianceMatrix(msr_t_Iterator begin, const matrix_2d &vmat)

References bms_meta_, debug_file, dynadjust::math::matrix_2d::elementadd(), FormInverseVarianceMatrix(), dynadjust::math::matrix_2d::get(), GetDirectionsVarianceMatrix(), PrintMsrVarianceMatrixException(), projectSettings_, dynadjust::math::matrix_2d::put(), dynadjust::math::matrix_2d::redim(), Seconds(), SetDirectionsVarianceMatrix(), SignalExceptionAdjustment(), and dynadjust::math::matrix_2d::zero().

Referenced by UpdateDesignNormalMeasMatrices_D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadVarianceMatrix_G()

void dynadjust::networkadjust::dna_adjust::LoadVarianceMatrix_G ( it_vmsr_t _it_msr,
matrix_2d * var_cart )
private

Definition at line 5220 of file dnaadjust.cpp.

5221{
5222 if (FormInverseVarianceMatrixReduced(_it_msr, var_cart, "LoadVarianceMatrix_G"))
5223 return;
5224
5225 // OK, load the GPS variance matrix from the binary
5226 // file, scaling where necessary
5227
5228 it_vmsr_t _it_msr_first(_it_msr);
5229 UINT32 v(0);
5230
5231 // Determine scaling
5232 double vScale, pScale, lScale, hScale;
5233 bool scaleMatrix, scalePartial;
5234 LoadVarianceScaling(_it_msr, vScale, pScale, lScale, hScale,
5235 scaleMatrix, scalePartial);
5236
5237 var_cart->redim(3, 3);
5238
5239 // vScale is performed on the fly, assuming that all VCVs for single baselines
5240 // will always be in the cartesian reference frame
5241
5242 var_cart->put(0, v, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // XX
5243
5244 _it_msr++;
5245 v++;
5246
5247 var_cart->put(0, v, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // YX
5248 var_cart->put(1, v, scaleMatrix ? _it_msr->term3 * vScale : _it_msr->term3); // YY
5249
5250 _it_msr++;
5251 v++;
5252
5253 var_cart->put(0, v, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // ZX
5254 var_cart->put(1, v, scaleMatrix ? _it_msr->term3 * vScale : _it_msr->term3); // ZY
5255 var_cart->put(2, v, scaleMatrix ? _it_msr->term4 * vScale : _it_msr->term4); // ZZ
5256
5257 bool lowerisClear(true);
5258 if (scaleMatrix || scalePartial)
5259 {
5260 var_cart->filllower();
5261 lowerisClear = false;
5262 }
5263
5264 try {
5265
5266 // Scale variance matrix using phi, lambda and height scalars?
5267 if (scalePartial)
5268 {
5269 it_vstn_t_const stn1_it(bstBinaryRecords_.begin() + _it_msr->station1);
5270 it_vstn_t_const stn2_it(bstBinaryRecords_.begin() + _it_msr->station2);
5271
5272 // Note - it makes little difference whether the start point, end point or mid point
5273 // is chosen to form the rotation matrix. Tests on a 1987.6 Km baseline show
5274 // sub-millimetre difference in the propagated results!
5275 // So no need to average - just use the starting point
5276
5277 ScaleGPSVCV<double>(*var_cart, var_cart,
5278 stn1_it->currentLatitude, stn1_it->currentLongitude, stn1_it->currentHeight,
5279 datum_.GetEllipsoidRef(),
5280 pScale, lScale, hScale);
5281 }
5282
5283 // Copy elements of scaled variance matrix to variances held in internal memory (_it_msr)
5284 // only if VCV has been scaled (by vScale, or by pScale+lScale+hScale).
5285 // This alleviates having to repeat any scaling for subsequent computations
5286 // involving variances (i.e. sigma zero, Pelzer's reliability, etc)
5287 if (scaleMatrix || scalePartial)
5288 SetGPSVarianceMatrix(_it_msr_first, *var_cart);
5289
5290 if (projectSettings_.a.stage)
5291 return;
5292
5293 // inverse
5294 FormInverseVarianceMatrix(var_cart, lowerisClear);
5295
5296 if (boost::math::isnan(var_cart->get(0, 0)) || boost::math::isinf(var_cart->get(0, 0)))
5297 {
5298 std::stringstream ss;
5299 ss << "Invalid variance matrix:" << std::endl;
5300 ss << std::setprecision(6) << std::fixed << *var_cart;
5301 SignalExceptionAdjustment(ss.str(), 0);
5302 }
5303 }
5304 catch (const std::runtime_error& e) {
5305
5306 // Print error message to adj file and throw exception
5307 std::stringstream ss;
5308 PrintMsrVarianceMatrixException(_it_msr_first, e, ss, "LoadVarianceMatrix_G");
5309 SignalExceptionAdjustment(ss.str(), 0);
5310 }
5311
5312 if (projectSettings_.g.verbose > 5)
5313 debug_file << std::endl << "Inv V.dxyz " << std::fixed << std::setprecision(16) << std::setw(26) << var_cart;
5314
5315}
bool FormInverseVarianceMatrixReduced(it_vmsr_t _it_msr, matrix_2d *var_cart, const std::string &method_name)
void LoadVarianceScaling(it_vmsr_t _it_msr, double &vScale, double &pScale, double &lScale, double &hScale, bool &scaleMatrix, bool &scalePartial)
void SetGPSVarianceMatrix(msr_t_Iterator begin, const matrix_2d &vmat)
void ScaleGPSVCV(const matrix_2d &mvariances, matrix_2d *mvariances_mod, const T &latitude, const T &longitude, const T &height, const CDnaEllipsoid *ellipsoid, const T &pScale, const T &lScale, const T &hScale)

References bstBinaryRecords_, datum_, debug_file, dynadjust::math::matrix_2d::filllower(), FormInverseVarianceMatrix(), FormInverseVarianceMatrixReduced(), dynadjust::math::matrix_2d::get(), LoadVarianceScaling(), PrintMsrVarianceMatrixException(), projectSettings_, dynadjust::math::matrix_2d::put(), dynadjust::math::matrix_2d::redim(), ScaleGPSVCV(), SetGPSVarianceMatrix(), and SignalExceptionAdjustment().

Referenced by UpdateDesignNormalMeasMatrices_G().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadVarianceMatrix_X()

void dynadjust::networkadjust::dna_adjust::LoadVarianceMatrix_X ( it_vmsr_t _it_msr,
matrix_2d * var_cart )
private

Definition at line 5318 of file dnaadjust.cpp.

5319{
5320 if (FormInverseVarianceMatrixReduced(_it_msr, var_cart, "LoadVarianceMatrix_X"))
5321 return;
5322
5323 // OK, load the GPS variance matrix from the binary
5324 // file, scaling where necessary
5325
5326 it_vmsr_t _it_msr_first(_it_msr);
5327
5328 UINT32 covr(0), covc(0);
5329 UINT32 cluster_bsl, baseline_count(_it_msr->vectorCount1);
5330 UINT32 cluster_cov, covariance_count;
5331 var_cart->redim(baseline_count * 3, baseline_count * 3);
5332
5333 matrix_2d mpositions(baseline_count * 3, 1);
5334
5335 it_vstn_t stn1_it;
5336 it_vstn_t stn2_it;
5337
5338 // Determine scaling
5339 double vScale, pScale, lScale, hScale;
5340 bool scaleMatrix, scalePartial;
5341 LoadVarianceScaling(_it_msr, vScale, pScale, lScale, hScale,
5342 scaleMatrix, scalePartial);
5343
5344 for (cluster_bsl=0; cluster_bsl<baseline_count; ++cluster_bsl) // number of baselines/points
5345 {
5346 covr = cluster_bsl * 3;
5347 covariance_count = _it_msr->vectorCount2;
5348
5349 stn1_it = bstBinaryRecords_.begin() + _it_msr->station1;
5350 stn2_it = bstBinaryRecords_.begin() + _it_msr->station2;
5351
5352 if (scalePartial)
5353 {
5354 // Note - it makes little difference whether the start point, end point or mid point
5355 // is chosen to form the rotation matrix. Tests on a 1987.6 Km baseline show
5356 // sub-millimetre difference in the propagated results!
5357 // So no need to average - just use the starting point
5358 mpositions.put(covr, 0, stn1_it->currentLatitude);
5359 mpositions.put(covr+1, 0, stn1_it->currentLongitude);
5360 mpositions.put(covr+2, 0, stn1_it->currentHeight);
5361 }
5362
5363 // vScale is performed on the fly, assuming that all VCVs for single baselines
5364 // will always be in the cartesian reference frame
5365
5366 var_cart->put(covr, covr, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // XX
5367
5368 _it_msr++;
5369
5370 var_cart->put(covr, covr+1, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // YX
5371 var_cart->put(covr+1, covr+1, scaleMatrix ? _it_msr->term3 * vScale : _it_msr->term3); // YY
5372
5373 _it_msr++;
5374
5375 var_cart->put(covr, covr+2, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // ZX
5376 var_cart->put(covr+1, covr+2, scaleMatrix ? _it_msr->term3 * vScale : _it_msr->term3); // ZY
5377 var_cart->put(covr+2, covr+2, scaleMatrix ? _it_msr->term4 * vScale : _it_msr->term4); // ZZ
5378
5379 if (covariance_count == 0)
5380 break;
5381
5382 covc = cluster_bsl * 3 + 3;
5383
5384 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov) // number of baseline/point covariances
5385 {
5386 covr = cluster_bsl * 3;
5387 _it_msr++; // X, lat
5388 var_cart->put(covr, covc, scaleMatrix ? _it_msr->term1 * vScale : _it_msr->term1); // m11
5389 var_cart->put(covr, covc+1, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // m12
5390 var_cart->put(covr, covc+2, scaleMatrix ? _it_msr->term3 * vScale : _it_msr->term3); // m13
5391
5392 covr++;
5393 _it_msr++; // Y, long
5394 var_cart->put(covr, covc, scaleMatrix ? _it_msr->term1 * vScale : _it_msr->term1); // m21
5395 var_cart->put(covr, covc+1, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // m22
5396 var_cart->put(covr, covc+2, scaleMatrix ? _it_msr->term3 * vScale : _it_msr->term3); // m23
5397
5398 covr++;
5399 _it_msr++; // Z, height
5400 var_cart->put(covr, covc, scaleMatrix ? _it_msr->term1 * vScale : _it_msr->term1); // m31
5401 var_cart->put(covr, covc+1, scaleMatrix ? _it_msr->term2 * vScale : _it_msr->term2); // m32
5402 var_cart->put(covr, covc+2, scaleMatrix ? _it_msr->term3 * vScale : _it_msr->term3); // m33
5403
5404 covc+=3;
5405 }
5406
5407 // next cluster measurement
5408 _it_msr++;
5409 }
5410
5411 bool lowerisClear(true);
5412
5413 try {
5414
5415 if (scaleMatrix || scalePartial)
5416 {
5417 if (scalePartial)
5418 {
5419 var_cart->filllower();
5420 lowerisClear = false;
5421 ScaleGPSVCV_Cluster<double>(*var_cart, var_cart,
5422 mpositions,
5423 datum_.GetEllipsoidRef(),
5424 pScale, lScale, hScale);
5425
5426 } // if (scalePartial)
5427
5428 // Copy elements of scaled variance matrix to variances held in internal memory (_it_msr)
5429 // This alleviates having to repeat any scaling for subsequent computations
5430 // involving variances (i.e. sigma zero, Pelzer's reliability, etc)
5431 SetGPSVarianceMatrix<it_vmsr_t>(_it_msr_first, *var_cart);
5432
5433 } // if (scaleMatrix || scalePartial)
5434 // inverse
5435 FormInverseVarianceMatrix(var_cart, lowerisClear);
5436
5437 if (boost::math::isnan(var_cart->get(0, 0)) || boost::math::isinf(var_cart->get(0, 0)))
5438 {
5439 std::stringstream ss;
5440 ss << "Invalid variance matrix:" << std::endl;
5441 ss << std::setprecision(6) << std::fixed << *var_cart;
5442 SignalExceptionAdjustment(ss.str(), 0);
5443 }
5444 }
5445 catch (const std::runtime_error& e) {
5446
5447 // Print error message to adj file and throw exception
5448 std::stringstream ss;
5449 PrintMsrVarianceMatrixException(_it_msr_first, e, ss, "LoadVarianceMatrix_X", baseline_count);
5450 SignalExceptionAdjustment(ss.str(), 0);
5451 }
5452
5453 if (projectSettings_.g.verbose > 5)
5454 debug_file << std::endl << "Inv V.dxyz " << std::fixed << std::setprecision(16) << std::setw(26) << var_cart;
5455
5456}
void ScaleGPSVCV_Cluster(const matrix_2d &mvariances, matrix_2d *mvariances_mod, const matrix_2d &mpositions, const CDnaEllipsoid *ellipsoid, const T &pScale, const T &lScale, const T &hScale, _COORD_TYPE_ coordType=XYZ_type_i)

References bstBinaryRecords_, datum_, debug_file, dynadjust::math::matrix_2d::filllower(), FormInverseVarianceMatrix(), FormInverseVarianceMatrixReduced(), dynadjust::math::matrix_2d::get(), LoadVarianceScaling(), PrintMsrVarianceMatrixException(), projectSettings_, dynadjust::math::matrix_2d::put(), dynadjust::math::matrix_2d::redim(), ScaleGPSVCV_Cluster(), SetGPSVarianceMatrix(), and SignalExceptionAdjustment().

Referenced by UpdateDesignNormalMeasMatrices_X().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadVarianceMatrix_Y()

void dynadjust::networkadjust::dna_adjust::LoadVarianceMatrix_Y ( it_vmsr_t _it_msr,
matrix_2d * var_cart,
const _COORD_TYPE_ coordType )
private

Definition at line 5500 of file dnaadjust.cpp.

5501{
5502 if (FormInverseVarianceMatrixReduced(_it_msr, var_cart, "LoadVarianceMatrix_Y"))
5503 return;
5504
5505 // OK, load the GPS variance matrix from the binary
5506 // file, scaling where necessary
5507
5508 it_vmsr_t _it_msr_first(_it_msr);
5509
5510 //**********************************************************************
5511 // NOTE!!!
5512 //
5513 // Scaling needs careful consideration. Three things are relevant
5514 // 1. Cluster may be in X,Y,Z or Lat,Long,Height
5515 // 2. Single v-scale may be supplied
5516 // 3. Phi, lambda and height scalars may be supplied
5517 //
5518 // if XYZ, scaling is as follows:
5519 // if both p,l,h scalars and v-scale are supplied, then
5520 // * rotate VCV to geographic,
5521 // * apply scalars in single step (i.e. multiply v-scale and p,l,h scalars)
5522 // * rotate VCV to cartesian
5523 //
5524 // if only v-scale supplied, then
5525 // * scale VCV
5526 //
5527 // else if PLH, scaling is as follows:
5528 // if p,l,h scalars are supplied then
5529 // * apply scalars in single step (i.e. multiply v-scale and p,l,h scalars)
5530 // * rotate VCV to cartesian
5531 // if v-scale supplied then
5532 // * scale VCV
5533 //
5534 // Hence, it makes no difference whether v-scale is performed
5535 // on a cartesian or geographic VCV.
5536 //
5537 //**********************************************************************
5538
5539 // Units for GPS point clusters are in:
5540 // - <Coords>LLH</Coords> -> radians^^2 and metres^2
5541 // - <Coords>XYZ</Coords> -> metres^2
5542 //
5543 // An example of LLH is as follows (from "uni_sqrmsr.xml")
5544 //
5545 // Worked example: <SigmaXX>9.402E-09</SigmaXX>
5546 // = 0.000000009402 (radians^2)
5547 // = 0.000096963911 (radians)
5548 // = 0.005555622855 (deg.ddddddd)
5549 // = 0.002000024228 (deg.mmsssss)
5550 // = 20.0 (seconds)
5551
5552
5553 UINT32 covr(0), covc(0);
5554 UINT32 cluster_pnt, point_count(_it_msr->vectorCount1);
5555 UINT32 cluster_cov, covariance_count;
5556
5557 // Determine scaling
5558 double vScale, pScale, lScale, hScale;
5559 bool scaleMatrix, scalePartial;
5560 LoadVarianceScaling(_it_msr, vScale, pScale, lScale, hScale,
5561 scaleMatrix, scalePartial);
5562
5563 var_cart->redim(point_count * 3, point_count * 3); // performs zero on creation of new elements
5564
5565 matrix_2d mpositions(point_count * 3, 1);
5566 it_vstn_t stn1_it;
5567
5568 for (cluster_pnt=0; cluster_pnt<point_count; ++cluster_pnt)
5569 {
5570 covr = cluster_pnt * 3;
5571 covariance_count = _it_msr->vectorCount2;
5572
5573 stn1_it = bstBinaryRecords_.begin() + _it_msr->station1;
5574
5575 // store latitude, longitude and ellipsoid height
5576 if (scalePartial || coordType == LLH_type_i)
5577 {
5578 mpositions.put(covr, 0, stn1_it->currentLatitude);
5579 mpositions.put(covr+1, 0, stn1_it->currentLongitude);
5580 mpositions.put(covr+2, 0, stn1_it->currentHeight);
5581 }
5582
5583 var_cart->put(covr, covr, _it_msr->term2); // XX
5584 _it_msr++;
5585
5586 var_cart->put(covr, covr+1, _it_msr->term2); // YX
5587 var_cart->put(covr+1, covr+1, _it_msr->term3); // YY
5588 _it_msr++;
5589
5590 var_cart->put(covr, covr+2, _it_msr->term2); // ZX
5591 var_cart->put(covr+1, covr+2, _it_msr->term3); // ZY
5592 var_cart->put(covr+2, covr+2, _it_msr->term4); // ZZ
5593
5594 if (covariance_count == 0)
5595 break;
5596
5597 covc = cluster_pnt * 3 + 3;
5598
5599 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov) // number of baseline/point covariances
5600 {
5601 covr = cluster_pnt * 3;
5602 _it_msr++; // X, lat
5603 var_cart->put(covr, covc, _it_msr->term1); // m11
5604 var_cart->put(covr, covc+1, _it_msr->term2); // m12
5605 var_cart->put(covr, covc+2, _it_msr->term3); // m13
5606
5607 covr++;
5608 _it_msr++; // Y, long
5609 var_cart->put(covr, covc, _it_msr->term1); // m11
5610 var_cart->put(covr, covc+1, _it_msr->term2); // m12
5611 var_cart->put(covr, covc+2, _it_msr->term3); // m13
5612
5613 covr++;
5614 _it_msr++; // Z, height
5615 var_cart->put(covr, covc, _it_msr->term1); // m11
5616 var_cart->put(covr, covc+1, _it_msr->term2); // m12
5617 var_cart->put(covr, covc+2, _it_msr->term3); // m13
5618
5619 covc+=3;
5620 }
5621
5622 _it_msr++;
5623 }
5624
5625 bool lowerisClear(true);
5626 if (scaleMatrix || scalePartial || coordType == LLH_type_i)
5627 {
5628 var_cart->filllower();
5629 lowerisClear = false;
5630 }
5631
5632 try {
5633
5634 // Scale variance matrix using phi, lambda and height scalars?
5635 if (scalePartial)
5636 // If v-scale has been supplied, partial scalars will have been
5637 // multiplied by v-scale in LoadVarianceScaling.
5638 // ScaleGPSVCV_Cluster also converts var_cart to cartesian system
5639 ScaleGPSVCV_Cluster<double>(*var_cart, var_cart,
5640 mpositions,
5641 datum_.GetEllipsoidRef(),
5642 pScale, lScale, hScale, coordType);
5643
5644 // Propagate variance matrix into cartesian reference frame?
5645 else if (coordType == LLH_type_i)
5647 mpositions,
5648 datum_.GetEllipsoidRef(),
5649 true); // Geographic -> Cartesian
5650
5651 if (scaleMatrix && !scalePartial)
5652 var_cart->scale(vScale);
5653
5654 // Copy elements of scaled variance matrix to variances held in internal memory (_it_msr)
5655 // only if VCV has been scaled (by vScale, or by pScale+lScale+hScale) or if VCV was
5656 // in PLH reference frame.
5657 // This alleviates having to repeat any scaling for subsequent computations
5658 // involving variances (i.e. sigma zero, Pelzer's reliability, etc)
5659 if (scaleMatrix || scalePartial || coordType == LLH_type_i)
5660 SetGPSVarianceMatrix<it_vmsr_t>(_it_msr_first, *var_cart);
5661
5662 // Perform inverse
5663 FormInverseVarianceMatrix(var_cart, lowerisClear);
5664
5665 if (boost::math::isnan(var_cart->get(0, 0)) || boost::math::isinf(var_cart->get(0, 0)))
5666 {
5667 std::stringstream ss;
5668 ss << "Invalid variance matrix:" << std::endl;
5669 ss << std::setprecision(6) << std::fixed << *var_cart;
5670 SignalExceptionAdjustment(ss.str(), 0);
5671 }
5672 }
5673 catch (const std::runtime_error& e) {
5674
5675 // Print error message to adj file and throw exception
5676 std::stringstream ss;
5677 PrintMsrVarianceMatrixException(_it_msr_first, e, ss, "LoadVarianceMatrix_Y", point_count);
5678 SignalExceptionAdjustment(ss.str(), 0);
5679 }
5680
5681 if (projectSettings_.g.verbose > 5)
5682 debug_file << std::endl << "Inv V.dxyz " << std::fixed << std::setprecision(16) << std::setw(26) << var_cart;
5683
5684}
matrix_2d scale(const double &scalar)
void PropagateVariances_GeoCart_Cluster(const matrix_2d &mvariances, matrix_2d *mvariances_mod, const matrix_2d &mpositions, matrix_2d &mrotations, const CDnaEllipsoid *ellipsoid, bool GEO_TO_CART, bool CALCULATE_ROTATIONS)

References bstBinaryRecords_, datum_, debug_file, dynadjust::math::matrix_2d::filllower(), FormInverseVarianceMatrix(), FormInverseVarianceMatrixReduced(), dynadjust::math::matrix_2d::get(), LLH_type_i, LoadVarianceScaling(), PrintMsrVarianceMatrixException(), projectSettings_, PropagateVariances_GeoCart_Cluster(), dynadjust::math::matrix_2d::put(), dynadjust::math::matrix_2d::redim(), dynadjust::math::matrix_2d::scale(), ScaleGPSVCV_Cluster(), SetGPSVarianceMatrix(), and SignalExceptionAdjustment().

Referenced by UpdateDesignNormalMeasMatrices_Y().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintMsrVarianceMatrixException()

void dynadjust::networkadjust::dna_adjust::PrintMsrVarianceMatrixException ( const it_vmsr_t & _it_msr,
const std::runtime_error & e,
std::stringstream & ss,
const std::string & calling_function,
const UINT32 msr_count = 0 )
private

Definition at line 4990 of file dnaadjust.cpp.

4992{
4993 it_vmsr_t _it_msr_temp(_it_msr);
4994
4995 switch (_it_msr->measType)
4996 {
4997 case 'D':
4998 ss << calling_function << "(): Cannot compute the" << std::endl <<
4999 " variance matrix for a round of " << msr_count << " directions commencing" << std::endl <<
5000 " with stations " << bstBinaryRecords_.at(_it_msr->station1).stationName << " and " <<
5001 bstBinaryRecords_.at(_it_msr->station2).stationName << ":" << std::endl;
5002
5003 ss << " ..." << std::endl <<
5004 " <Value>" << FormatDmsString(RadtoDms(_it_msr->term1), PRECISION_SEC_MSR, true, false) << "</Value>" << std::endl <<
5005 " ..." << std::endl << std::endl;
5006 break;
5007 case 'G':
5008 ss << calling_function << "(): Cannot invert the" << std::endl <<
5009 " variance matrix for a GPS baseline between stations " <<
5010 bstBinaryRecords_.at(_it_msr->station1).stationName << " and " <<
5011 bstBinaryRecords_.at(_it_msr->station2).stationName << ":" << std::endl;
5012
5013 ss << " ..." << std::endl <<
5014 " <x>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</x>" << std::endl;
5015 _it_msr_temp++;
5016 ss << " <y>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</y>" << std::endl;
5017 _it_msr_temp++;
5018 ss << " <z>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</z>" << std::endl <<
5019 " ..." << std::endl << std::endl;
5020 break;
5021 case 'X':
5022 ss << calling_function << "(): Cannot invert the" << std::endl <<
5023 " variance matrix for a " << msr_count << "-baseline GPS baseline cluster commencing" << std::endl <<
5024 " with stations " << bstBinaryRecords_.at(_it_msr->station1).stationName << " and " <<
5025 bstBinaryRecords_.at(_it_msr->station2).stationName << ":" << std::endl;
5026
5027 ss << " ..." << std::endl <<
5028 " <x>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</x>" << std::endl;
5029 _it_msr_temp++;
5030 ss << " <y>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</y>" << std::endl;
5031 _it_msr_temp++;
5032 ss << " <z>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</z>" << std::endl <<
5033 " ..." << std::endl << std::endl;
5034 break;
5035 case 'Y':
5036 ss << calling_function << "(): Cannot invert the" << std::endl <<
5037 " variance matrix for a " << msr_count << "-station GPS point cluster commencing" << std::endl <<
5038 " with station " << bstBinaryRecords_.at(_it_msr->station1).stationName << ":" << std::endl;
5039
5040 ss << " ..." << std::endl <<
5041 " <x>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</x>" << std::endl;
5042 _it_msr_temp++;
5043 ss << " <y>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</y>" << std::endl;
5044 _it_msr_temp++;
5045 ss << " <z>" << std::fixed << std::setprecision(PRECISION_MTR_MSR) << _it_msr_temp->term1 << "</z>" << std::endl <<
5046 " ..." << std::endl << std::endl;
5047 break;
5048 }
5049
5050 ss <<
5051 " Detailed description: " << e.what() << std::endl <<
5052 " Options: " << std::endl <<
5053 " - Check the validity of the variance matrix and any relevant " << std::endl <<
5054 " scalars and re-attempt the adjustment." << std::endl <<
5055 " - If this fails, set the ignore flag in the measurement file and re-import " << std::endl <<
5056 " the station and measurement files." << std::endl;
5057
5058 adj_file << " " << ss.str() << std::endl;
5059 adj_file.flush();
5060}
std::string FormatDmsString(const T &dDegMinSec, const int precision, bool withSpaces, bool withSymbols)

References adj_file, bstBinaryRecords_, FormatDmsString(), PRECISION_MTR_MSR, PRECISION_SEC_MSR, and RadtoDms().

Referenced by FormInverseVarianceMatrixReduced(), LoadVarianceMatrix_D(), LoadVarianceMatrix_G(), LoadVarianceMatrix_X(), and LoadVarianceMatrix_Y().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareStationandVarianceMatrices()

void dynadjust::networkadjust::dna_adjust::PrepareStationandVarianceMatrices ( const UINT32 & block)
private

Definition at line 887 of file dnaadjust.cpp.

888{
889 // Is this a staged adjustment for which the matrix data is to be loaded from
890 // existing stage files created from a previous run?
891 if (projectSettings_.a.stage && !projectSettings_.a.recreate_stage_files && bms_meta_.reduced)
892 {
893 // Staged adjustments only.
894 // Load matrix data from existing .mtx stage files
895 // created from a previous run.
896
897 // redimension the estimated stations matrix
898 v_estimatedStations_.at(block).setsize(v_unknownsCount_.at(block), 1);
899
900 // redimension the original stations
901 v_originalStations_.at(block).setsize(v_unknownsCount_.at(block), 1);
902 }
903 else
904 {
905 // Simultaneous, phased (multithreaded and staged) adjustments
906 // For staged adjustments, create new .mtx stage files
907
908 // redimension the estimated stations matrix
909 v_estimatedStations_.at(block).redim(v_unknownsCount_.at(block), 1);
910
911 // redimension the original stations
912 v_originalStations_.at(block).redim(v_unknownsCount_.at(block), 1);
913 }
914
915 // Populate matrices with coordinates and
916 // for phased adjustment, add junction stations
917 switch (projectSettings_.a.adjust_mode)
918 {
919 case SimultaneousMode:
921 break;
923 case PhasedMode:
924
925 UINT32 j(static_cast<UINT32>(v_JSL_.at(block).size() * 3));
926
927 // Is this a staged adjustment for which the matrix data is to be loaded from
928 // existing stage files created from a previous run?
929 if (projectSettings_.a.stage && !projectSettings_.a.recreate_stage_files && bms_meta_.reduced)
930 {
931 // Staged adjustments only.
932 // Load matrix data from existing .mtx stage files
933 // created from a previous run.
934
935 // resize rigorous coordinate estimate array
936 v_rigorousStations_.at(block).setsize(v_unknownsCount_.at(block), 1);
937
938 // resize rigorous variances
939 v_rigorousVariances_.at(block).setsize(v_unknownsCount_.at(block), v_unknownsCount_.at(block));
940
941 // resize junction variances
942 v_junctionVariances_.at(block).setsize(j, j);
943
944 // resize junction station coordinate estimate arrays
945 if (!v_blockMeta_.at(block)._blockLast && !v_blockMeta_.at(block)._blockIsolated)
946 {
947 v_junctionVariancesFwd_.at(block).setsize(j, j);
948 v_junctionEstimatesFwd_.at(block).setsize(j, 1);
949 v_junctionEstimatesRev_.at(block+1).setsize(j, 1);
950 }
951 }
952 else
953 {
954 // Phased (multithreaded and staged) adjustments
955 // For staged adjustments, create new .mtx stage files
956
957 // resize rigorous coordinate estimate array
958 v_rigorousStations_.at(block).redim(v_unknownsCount_.at(block), 1);
959
960 // resize rigorous variances
961 v_rigorousVariances_.at(block).redim(v_unknownsCount_.at(block), v_unknownsCount_.at(block));
962
963 // resize junction variances
964 v_junctionVariances_.at(block).redim(j, j);
965
966 // resize junction station coordinate estimate arrays
967 if (!v_blockMeta_.at(block)._blockLast && !v_blockMeta_.at(block)._blockIsolated)
968 {
969 v_junctionVariancesFwd_.at(block).redim(j, j);
970 v_junctionEstimatesFwd_.at(block).redim(j, 1);
971 v_junctionEstimatesRev_.at(block+1).redim(j, 1);
972 }
973
975 }
976 break;
977 }
978}
void PopulateEstimatedStationMatrix(const UINT32 &block, UINT32 &unknownParams)

References bms_meta_, Phased_Block_1Mode, PhasedMode, PopulateEstimatedStationMatrix(), projectSettings_, SimultaneousMode, unknownParams_, v_blockMeta_, v_estimatedStations_, v_JSL_, v_junctionEstimatesFwd_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesFwd_, v_originalStations_, v_rigorousStations_, v_rigorousVariances_, v_unknownParams_, and v_unknownsCount_.

Referenced by PrepareAdjustmentBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareMappedRegions()

void dynadjust::networkadjust::dna_adjust::PrepareMappedRegions ( const UINT32 & block)
private

Definition at line 30 of file dnaadjust-stage.cpp.

31{
32 if (projectSettings_.a.adjust_mode == SimultaneousMode)
33 return;
34 if (projectSettings_.a.multi_thread)
35 return;
36
37 // Set memory map region offsets for all
38 // matrices associated with this block
39 SetRegionOffsets(block);
40
41 // Set memory mapped file regions
42 // NOTE - previously created files must exist and match the
43 // dimensions of the current matrix sizes
44 try {
46 }
47 catch (boost::interprocess::interprocess_exception& e){
48 std::stringstream ss;
49 ss << "PrepareMappedRegions() terminated while creating memory map" << std::endl;
50 ss << " regions from .mtx stage files. Details:\n " << e.what() << std::endl << std::endl;
51 ss << " Please ensure the .mtx stage files from a previous staged" << std::endl;
52 ss << " adjustment exist, or re-run the adjustment using the" << std::endl;
53 ss << " --" << RECREATE_STAGE_FILES << " option." << std::endl;
54 adj_file << std::endl << "- Error: " << ss.str() << std::endl;
55 throw boost::enable_current_exception(std::runtime_error(ss.str()));
56 }
57}

References adj_file, PrepareMemoryMapRegions(), projectSettings_, RECREATE_STAGE_FILES, SetRegionOffsets(), and SimultaneousMode.

Referenced by PrepareAdjustmentBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateEstimatedStationMatrix()

void dynadjust::networkadjust::dna_adjust::PopulateEstimatedStationMatrix ( const UINT32 & block,
UINT32 & unknownParams )
private

Definition at line 818 of file dnaadjust.cpp.

819{
820 // assign inner and junction station coordinates
821 it_vUINT32_const _it_stn;
822
823 double X, Y, Z;
824 UINT32 j(0);
825
826 // add inner and junction stations (all stations in phased mode are kept in v_parameterStationList_)
827 for (_it_stn=v_parameterStationList_.at(block).begin();
828 _it_stn!=v_parameterStationList_.at(block).end();
829 ++_it_stn)
830 {
832 bstBinaryRecords_.at(*_it_stn).currentLatitude,
833 bstBinaryRecords_.at(*_it_stn).currentLongitude,
834 bstBinaryRecords_.at(*_it_stn).currentHeight,
835 &X, &Y, &Z, datum_.GetEllipsoidRef());
836
837 // add junction stations
838 switch (projectSettings_.a.adjust_mode)
839 {
841 case PhasedMode:
842 v_rigorousStations_.at(block).put(j, 0, X);
843 }
844
845 v_estimatedStations_.at(block).put(j, 0, X);
846 v_originalStations_.at(block).put(j++, 0, X);
847
848 // add junction stations
849 switch (projectSettings_.a.adjust_mode)
850 {
852 case PhasedMode:
853 v_rigorousStations_.at(block).put(j, 0, Y);
854 }
855
856 v_estimatedStations_.at(block).put(j, 0, Y);
857 v_originalStations_.at(block).put(j++, 0, Y);
858
859 // add junction stations
860 switch (projectSettings_.a.adjust_mode)
861 {
863 case PhasedMode:
864 v_rigorousStations_.at(block).put(j, 0, Z);
865 }
866
867 v_estimatedStations_.at(block).put(j, 0, Z);
868 v_originalStations_.at(block).put(j++, 0, Z);
869
870
871 // assign appropriate variances for constraint stations
872 if (bstBinaryRecords_.at((*_it_stn)).stationConst[0] == 'C')
873 unknownParams--;
874
875 if (bstBinaryRecords_.at((*_it_stn)).stationConst[1] == 'C')
876 unknownParams--;
877
878 if (bstBinaryRecords_.at((*_it_stn)).stationConst[2] == 'C')
879 unknownParams--;
880 }
881
882 if (unknownParams_ == 0 && unknownsCount_ > 0)
883 allStationsFixed_ = true;
884}

References allStationsFixed_, bstBinaryRecords_, datum_, GeoToCart(), Phased_Block_1Mode, PhasedMode, projectSettings_, unknownParams_, unknownsCount_, v_estimatedStations_, v_originalStations_, v_parameterStationList_, and v_rigorousStations_.

Referenced by PrepareStationandVarianceMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CarryStnEstimatesandVariancesForward()

void dynadjust::networkadjust::dna_adjust::CarryStnEstimatesandVariancesForward ( const UINT32 & thisBlock,
const UINT32 & nextBlock )
private

Definition at line 1147 of file dnaadjust.cpp.

1148{
1149 UINT32 jsl, jsl_cov;
1150 UINT32 jslvar, jslcovar;
1151 UINT32 est(0);
1152
1153 it_vUINT32 _it_jsl(v_JSL_.at(thisBlock).begin()), _it_jsl_cov;
1154
1155 // 1. Copy full covariance matrix and coordinate estimates of junctions to temporary
1156 for (_it_jsl=v_JSL_.at(thisBlock).begin(); _it_jsl!=v_JSL_.at(thisBlock).end(); ++_it_jsl)
1157 {
1158 // get index of this JSL
1159 jslvar = static_cast<UINT32>(std::distance(v_JSL_.at(thisBlock).begin(), _it_jsl) * 3);
1160 jsl = v_blockStationsMap_.at(thisBlock)[*_it_jsl] * 3;
1161
1162 // copy variance elements for this JSL
1163 v_junctionVariances_.at(thisBlock).copyelements(jslvar, jslvar,
1164 v_normals_.at(thisBlock), jsl, jsl, 3, 3);
1165
1166 // copy junction estimates
1167 v_junctionEstimatesFwd_.at(thisBlock).copyelements(est, 0,
1168 v_estimatedStations_.at(thisBlock), jsl, 0, 3, 1);
1169
1170 est += 3;
1171
1172 // copy covariance elements for this JSL
1173 for (_it_jsl_cov=_it_jsl; _it_jsl_cov!=v_JSL_.at(thisBlock).end(); ++_it_jsl_cov)
1174 {
1175 // don't re-copy variances
1176 if (*_it_jsl_cov == *_it_jsl)
1177 continue;
1178
1179 jslcovar = static_cast<UINT32>(std::distance(v_JSL_.at(thisBlock).begin(), _it_jsl_cov) * 3);
1180 jsl_cov = v_blockStationsMap_.at(thisBlock)[*_it_jsl_cov] * 3;
1181 v_junctionVariances_.at(thisBlock).copyelements(jslvar, jslcovar,
1182 v_normals_.at(thisBlock), jsl, jsl_cov, 3, 3);
1183 v_junctionVariances_.at(thisBlock).copyelements(jslcovar, jslvar,
1184 v_normals_.at(thisBlock), jsl_cov, jsl, 3, 3);
1185 }
1186 }
1187
1188 if (projectSettings_.g.verbose > 5)
1189 {
1190 debug_file << "Variance matrix of junction station(s) ";
1191 for (_it_jsl=v_JSL_.at(thisBlock).begin(); _it_jsl!=v_JSL_.at(thisBlock).end(); ++_it_jsl)
1192 debug_file << bstBinaryRecords_.at(*_it_jsl).stationName << " ";
1193 debug_file << "carried forward: " << std::scientific << std::setprecision(16) << v_junctionVariances_.at(thisBlock);
1194 }
1195
1196 // 2. Perform inverse
1198
1199 // 3. Copy junction station variances for use in reverse combination adjustment
1200 v_junctionVariancesFwd_.at(thisBlock) = v_junctionVariances_.at(thisBlock);
1201
1202 // 4. Grow msr-comp and AtVinv matrices for next block to include junction stations as measurements
1203 UINT32 pseudoMsrCount(static_cast<UINT32>(v_JSL_.at(thisBlock).size()));
1204 UINT32 pseudoMsrElemCount(pseudoMsrCount * 3);
1205 UINT32 paramCount(0), paramCount2, msrCountNext(v_measurementParams_.at(nextBlock));
1206
1207 // grow matrices to accommodate JSL measurements
1208 v_measMinusComp_.at(nextBlock).grow(pseudoMsrElemCount, 0);
1209 v_AtVinv_.at(nextBlock).grow(0, pseudoMsrElemCount);
1210
1211 // zero elements used in a prior iteration
1212 v_AtVinv_.at(nextBlock).zero(0, msrCountNext, v_AtVinv_.at(nextBlock).rows(), pseudoMsrElemCount);
1213
1214 // 5. Add the temporary variance matrix to the normals of the next block, and form the
1215 // msr-comp elements
1216 for (_it_jsl=v_JSL_.at(thisBlock).begin();
1217 _it_jsl!=v_JSL_.at(thisBlock).end();
1218 ++_it_jsl, paramCount+=3)
1219 {
1220 // get index of this JSL in the next block
1221 jsl = v_blockStationsMap_.at(nextBlock)[*_it_jsl] * 3; // next block
1222 jslvar = static_cast<UINT32>(std::distance(v_JSL_.at(thisBlock).begin(), _it_jsl) * 3);
1223
1224 // add variance elements for this JSL to normals of the next block
1225 v_normals_.at(nextBlock).blockadd(jsl, jsl,
1226 v_junctionVariances_.at(thisBlock), jslvar, jslvar, 3, 3);
1227
1228 // copy variances elements for this JSL to v_AtVinv_ of the next block
1229 v_AtVinv_.at(nextBlock).copyelements(jsl, v_measurementParams_.at(nextBlock) + paramCount,
1230 v_junctionVariances_.at(thisBlock), jslvar, jslvar, 3, 3);
1231
1232 // msr-comp elements
1233 // Measured-computed for junction stations carried forward (from thisBlock-1)
1234 // add station X measurement
1235 v_measMinusComp_.at(nextBlock).put(msrCountNext++, 0,
1236 (v_junctionEstimatesFwd_.at(thisBlock).get(jslvar, 0) -
1237 v_estimatedStations_.at(nextBlock).get(jsl, 0))); // X (meas - computed)
1238
1239 // add station Y measurement
1240 v_measMinusComp_.at(nextBlock).put(msrCountNext++, 0,
1241 (v_junctionEstimatesFwd_.at(thisBlock).get(jslvar+1, 0) -
1242 v_estimatedStations_.at(nextBlock).get(jsl+1, 0))); // Y (meas - computed)
1243
1244 // add station Z measurement
1245 v_measMinusComp_.at(nextBlock).put(msrCountNext++, 0,
1246 (v_junctionEstimatesFwd_.at(thisBlock).get(jslvar+2, 0) -
1247 v_estimatedStations_.at(nextBlock).get(jsl+2, 0))); // Z (meas - computed)
1248
1249 paramCount2 = 0;
1250
1251 // get index of all covariances for this JSL in the next block
1252 for (_it_jsl_cov=_it_jsl;
1253 _it_jsl_cov!=v_JSL_.at(thisBlock).end();
1254 ++_it_jsl_cov, paramCount2+=3)
1255 {
1256 // don't re-copy variances
1257 if (*_it_jsl_cov == *_it_jsl)
1258 continue;
1259
1260 jslcovar = static_cast<UINT32>(std::distance(v_JSL_.at(thisBlock).begin(), _it_jsl_cov) * 3);
1261 jsl_cov = v_blockStationsMap_.at(nextBlock)[*_it_jsl_cov] * 3; // next block
1262
1263 // copy covariance elements for this JSL to normals of the next block
1264 v_normals_.at(nextBlock).blockadd(jsl, jsl_cov,
1265 v_junctionVariances_.at(thisBlock), jslvar, jslcovar, 3, 3);
1266 v_normals_.at(nextBlock).blockadd(jsl_cov, jsl,
1267 v_junctionVariances_.at(thisBlock), jslcovar, jslvar, 3, 3);
1268
1269 // copy covariance elements for this JSL to v_AtVinv_ of the next block
1270 v_AtVinv_.at(nextBlock).copyelements(jsl_cov, v_measurementParams_.at(nextBlock) + paramCount,
1271 v_junctionVariances_.at(thisBlock), jslcovar, jslvar, 3, 3);
1272
1273 v_AtVinv_.at(nextBlock).copyelements(jsl, v_measurementParams_.at(nextBlock) + paramCount + paramCount2,
1274 v_junctionVariances_.at(thisBlock), jslvar, jslcovar, 3, 3);
1275 }
1276 }
1277}

References bstBinaryRecords_, debug_file, FormInverseVarianceMatrix(), projectSettings_, v_AtVinv_, v_blockStationsMap_, v_estimatedStations_, v_JSL_, v_junctionEstimatesFwd_, v_junctionVariances_, v_junctionVariancesFwd_, v_measMinusComp_, v_measurementParams_, and v_normals_.

Referenced by CarryForwardJunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CarryStnEstimatesandVariancesReverse()

void dynadjust::networkadjust::dna_adjust::CarryStnEstimatesandVariancesReverse ( const UINT32 & nextBlock,
const UINT32 & thisBlock,
bool MT_ReverseOrCombine )
private

Definition at line 1282 of file dnaadjust.cpp.

1283{
1284 UINT32 jsl_var_order_this, jsl_var_order_next, jsl_covar_order_this, jsl_covar_order_next;
1285 UINT32 jsl_var_next, jsl_covar_next;
1286 UINT32 est(0);
1287
1288 matrix_2d* junctionVariances(&v_junctionVariances_.at(nextBlock));
1289 matrix_2d* aposterioriVariances(&v_normals_.at(thisBlock));
1290 matrix_2d* estimatedStationsThis(&v_estimatedStations_.at(thisBlock));
1291 matrix_2d* estimatedStationsNext(&v_estimatedStations_.at(nextBlock));
1292 matrix_2d* normals(&v_normals_.at(nextBlock));
1293 matrix_2d* measMinusCompNext(&v_measMinusComp_.at(nextBlock));
1294 matrix_2d* AtVinvNext(&v_AtVinv_.at(nextBlock));
1295
1296 if (MT_ReverseOrCombine)
1297 {
1298 junctionVariances = &v_junctionVariancesR_.at(nextBlock);
1299 aposterioriVariances = &v_normalsR_.at(thisBlock);
1300 estimatedStationsThis = &v_estimatedStationsR_.at(thisBlock);
1301 estimatedStationsNext = &v_estimatedStationsR_.at(nextBlock);
1302 normals = &v_normalsR_.at(nextBlock);
1303 measMinusCompNext = &v_measMinusCompR_.at(nextBlock);
1304 AtVinvNext = &v_AtVinvR_.at(nextBlock);
1305 }
1306
1307 it_vUINT32 _it_jsl(v_JSL_.at(nextBlock).begin()), _it_jsl_cov;
1308
1309 // 1. Copy full covariance matrix and coordinate estimates of junctions to temporary
1310 for (_it_jsl=v_JSL_.at(nextBlock).begin(); _it_jsl!=v_JSL_.at(nextBlock).end(); ++_it_jsl)
1311 {
1312 // get index of this JSL
1313 jsl_var_next = static_cast<UINT32>(std::distance(v_JSL_.at(nextBlock).begin(), _it_jsl) * 3);
1314 jsl_var_order_this = v_blockStationsMap_.at(thisBlock)[*_it_jsl] * 3;
1315
1316 // copy junction variance elements
1317 junctionVariances->copyelements(jsl_var_next, jsl_var_next,
1318 aposterioriVariances, jsl_var_order_this, jsl_var_order_this, 3, 3);
1319
1320 // copy junction estimates
1321 v_junctionEstimatesRev_.at(thisBlock).copyelements(est, 0,
1322 estimatedStationsThis, jsl_var_order_this, 0, 3, 1);
1323
1324 est += 3;
1325
1326 // copy upper covariances for this JSL in the next block
1327 for (_it_jsl_cov=_it_jsl; _it_jsl_cov!=v_JSL_.at(nextBlock).end(); ++_it_jsl_cov)
1328 {
1329 // don't re-copy variances
1330 if (*_it_jsl_cov == *_it_jsl)
1331 continue;
1332
1333 jsl_covar_next = static_cast<UINT32>(std::distance(v_JSL_.at(nextBlock).begin(), _it_jsl_cov) * 3);
1334 jsl_covar_order_this = v_blockStationsMap_.at(thisBlock)[*_it_jsl_cov] * 3;
1335 junctionVariances->copyelements(jsl_var_next, jsl_covar_next,
1336 aposterioriVariances, jsl_var_order_this, jsl_covar_order_this, 3, 3);
1337 junctionVariances->copyelements(jsl_covar_next, jsl_var_next,
1338 aposterioriVariances, jsl_covar_order_this, jsl_var_order_this, 3, 3);
1339 }
1340 }
1341
1342 if (projectSettings_.g.verbose > 5)
1343 {
1344 debug_file << "Variance matrix of junction station(s) ";
1345 for (_it_jsl=v_JSL_.at(nextBlock).begin(); _it_jsl!=v_JSL_.at(nextBlock).end(); ++_it_jsl)
1346 debug_file << bstBinaryRecords_.at(*_it_jsl).stationName << " ";
1347 debug_file << "carried reverse: " << std::scientific << std::setprecision(16) << v_junctionVariances_.at(thisBlock);
1348 }
1349
1350 // 2. Perform inverse
1351 FormInverseVarianceMatrix(junctionVariances);
1352
1353 // 3. Grow msr-comp and AtVinv matrices for next block to include junction stations as measurements
1354 UINT32 pseudoMsrCount(static_cast<UINT32>(v_JSL_.at(nextBlock).size()));
1355 UINT32 pseudoMsrElemCount(pseudoMsrCount * 3);
1356 UINT32 paramCount(0), paramCount2, msrCountNext(v_measurementParams_.at(nextBlock));
1357
1358 // grow matrices to accommodate JSL measurements
1359 measMinusCompNext->grow(pseudoMsrElemCount, 0);
1360 AtVinvNext->grow(0, pseudoMsrElemCount);
1361
1362 // zero elements used in the forward pass
1363 AtVinvNext->zero(0, msrCountNext, AtVinvNext->rows(), pseudoMsrElemCount);
1364
1365 // 4. Add the temporary variance matrix to the normals of the next block, and form the
1366 // msr-comp elements
1367 for (_it_jsl=v_JSL_.at(nextBlock).begin();
1368 _it_jsl!=v_JSL_.at(nextBlock).end();
1369 ++_it_jsl, paramCount+=3)
1370 {
1371 // get index of this JSL in the next block
1372 jsl_var_next = static_cast<UINT32>(std::distance(v_JSL_.at(nextBlock).begin(), _it_jsl) * 3);
1373 jsl_var_order_this = v_blockStationsMap_.at(thisBlock)[*_it_jsl] * 3; // previous block
1374 jsl_var_order_next = v_blockStationsMap_.at(nextBlock)[*_it_jsl] * 3;
1375
1376 // add variance elements for this JSL to normals of the next block
1377 normals->blockadd(jsl_var_order_next, jsl_var_order_next,
1378 *junctionVariances, jsl_var_next, jsl_var_next, 3, 3);
1379
1380 // copy variances elements for this JSL to v_AtVinv_ of the next block
1381 AtVinvNext->copyelements(jsl_var_order_next, v_measurementParams_.at(nextBlock) + paramCount,
1382 junctionVariances, jsl_var_next, jsl_var_next, 3, 3);
1383
1384 // msr-comp elements
1385 // Measured-computed for junction stations carried forward (from thisBlock-1)
1386 // add station X measurement
1387 measMinusCompNext->put(msrCountNext++, 0,
1388 (v_junctionEstimatesRev_.at(thisBlock).get(jsl_var_next, 0) -
1389 estimatedStationsNext->get(jsl_var_order_next, 0))); // X (meas - computed)
1390
1391 // add station Y measurement
1392 measMinusCompNext->put(msrCountNext++, 0,
1393 (v_junctionEstimatesRev_.at(thisBlock).get(jsl_var_next+1, 0) -
1394 estimatedStationsNext->get(jsl_var_order_next+1, 0))); // Y (meas - computed)
1395
1396 // add station Z measurement
1397 measMinusCompNext->put(msrCountNext++, 0,
1398 (v_junctionEstimatesRev_.at(thisBlock).get(jsl_var_next+2, 0) -
1399 estimatedStationsNext->get(jsl_var_order_next+2, 0))); // Z (meas - computed)
1400
1401 paramCount2 = 0;
1402
1403 // get index of all covariances for this JSL in the next block
1404 for (_it_jsl_cov=_it_jsl;
1405 _it_jsl_cov!=v_JSL_.at(nextBlock).end();
1406 ++_it_jsl_cov, paramCount2+=3)
1407 {
1408 // don't re-copy variances
1409 if (*_it_jsl_cov == *_it_jsl)
1410 continue;
1411
1412 jsl_covar_next = static_cast<UINT32>(std::distance(v_JSL_.at(nextBlock).begin(), _it_jsl_cov) * 3);
1413 jsl_covar_order_next = v_blockStationsMap_.at(nextBlock)[*_it_jsl_cov] * 3;
1414
1415 // add covariance elements for this JSL to normals of the next block
1416 normals->blockadd(jsl_covar_order_next, jsl_var_order_next,
1417 *junctionVariances, jsl_covar_next, jsl_var_next, 3, 3);
1418
1419 normals->blockadd(jsl_var_order_next, jsl_covar_order_next,
1420 *junctionVariances, jsl_var_next, jsl_covar_next, 3, 3);
1421
1422 // copy covariance elements for this JSL to v_AtVinv_ of the next block
1423 AtVinvNext->copyelements(jsl_covar_order_next, v_measurementParams_.at(nextBlock) + paramCount,
1424 junctionVariances, jsl_covar_next, jsl_var_next, 3, 3);
1425
1426 AtVinvNext->copyelements(jsl_var_order_next, v_measurementParams_.at(nextBlock) + paramCount + paramCount2,
1427 junctionVariances, jsl_var_next, jsl_covar_next, 3, 3);
1428 }
1429 }
1430}

References dynadjust::math::matrix_2d::blockadd(), bstBinaryRecords_, dynadjust::math::matrix_2d::copyelements(), debug_file, FormInverseVarianceMatrix(), dynadjust::math::matrix_2d::get(), dynadjust::math::matrix_2d::grow(), projectSettings_, dynadjust::math::matrix_2d::put(), dynadjust::math::matrix_2d::rows(), v_AtVinv_, v_AtVinvR_, v_blockStationsMap_, v_estimatedStations_, v_estimatedStationsR_, v_JSL_, v_junctionEstimatesRev_, v_junctionVariances_, v_junctionVariancesR_, v_measMinusComp_, v_measMinusCompR_, v_measurementParams_, v_normals_, v_normalsR_, and dynadjust::math::matrix_2d::zero().

Referenced by CarryReverseJunctions().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CarryStnEstimatesandVariancesCombine()

void dynadjust::networkadjust::dna_adjust::CarryStnEstimatesandVariancesCombine ( const UINT32 & nextBlock,
const UINT32 & thisBlock,
UINT32 & pseudomsrJSLCount,
bool MT_ReverseOrCombine )
private

Definition at line 4147 of file dnaadjust.cpp.

4150{
4151 UINT32 pseudomsrJSLBegin(v_measurementParams_.at(thisBlock));
4152
4153 // intermediate last
4154 // _____________ _____________
4155 // | | | |
4156 // | msr-comp | | msr-comp |
4157 // |_____________| |_____________| /__ pseudomsrJSLBegin
4158 // | | | |
4159 // | jrev-comp | | jfwd-comp |
4160 // |_____________| /__ pseudomsrJSLBegin |_____________|
4161 // | |
4162 // | jfwd-comp |
4163 // |_____________|
4164
4165 if (!v_blockMeta_.at(thisBlock)._blockLast)
4166 // PrepareAdjustmentCombine will have already weeded out
4167 // irrelevant blocks by testing _blockIsolated and _blockFirst
4168 // So, add sufficient elements for junction station elements from
4169 // reverse pass.
4170 pseudomsrJSLBegin += static_cast<UINT32>(v_JSL_.at(thisBlock).size() * 3); // junctions from reverse
4171
4172 UINT32 pseudoMsrCount(static_cast<UINT32>(v_JSL_.at(nextBlock).size())); // junctions from forward
4173 UINT32 pseudoMsrElemCount(pseudoMsrCount * 3);
4174
4175 matrix_2d* AtVinv(&v_AtVinv_.at(thisBlock));
4176 matrix_2d* normals(&v_normals_.at(thisBlock));
4177 matrix_2d* measMinusComp(&v_measMinusComp_.at(thisBlock));
4178 matrix_2d* estimatedStations(&v_estimatedStations_.at(thisBlock));
4179
4180 if (MT_ReverseOrCombine)
4181 {
4182 // restore backup copy of normals
4183 v_normalsR_.at(thisBlock) = v_normalsRC_.at(thisBlock);
4184 normals = &v_normalsR_.at(thisBlock);
4185
4186 AtVinv = &v_AtVinvR_.at(thisBlock);
4187 measMinusComp = &v_measMinusCompR_.at(thisBlock);
4188 estimatedStations = &v_estimatedStationsR_.at(thisBlock);
4189 }
4190 else
4191 {
4192
4193 // restore normals for single thread mode
4194 // v_normalsR_.at(thisBlock) is the set of normals with constraints
4195 // formed during the reverse adjustment
4196 v_normals_.at(thisBlock) = v_normalsR_.at(thisBlock);
4197
4198 }
4199
4200 AtVinv->grow(0, pseudoMsrElemCount);
4201 measMinusComp->grow(pseudoMsrElemCount, 0);
4202
4203 pseudomsrJSLCount = measMinusComp->rows() - v_measurementParams_.at(thisBlock);
4204
4205 UINT32 jsl, jsl_cov1, jslvar, jslcovar, paramCount, paramCount2;
4206 it_vUINT32 _it_jsl(v_JSL_.at(nextBlock).begin()), _it_jsl_cov;
4207
4208 paramCount = 0;
4209
4210 // Copy the junction variances from nextBlock (from forward) to thisBlock
4211 for (_it_jsl=v_JSL_.at(nextBlock).begin();
4212 _it_jsl!=v_JSL_.at(nextBlock).end();
4213 ++_it_jsl, paramCount+=3)
4214 {
4215 // get index of this JSL in the next block
4216 jsl = v_blockStationsMap_.at(thisBlock)[*_it_jsl] * 3;
4217 jslvar = static_cast<UINT32>(std::distance(v_JSL_.at(nextBlock).begin(), _it_jsl) * 3);
4218
4219 // add variances for this JSL to normals
4220 normals->blockadd(jsl, jsl,
4221 v_junctionVariancesFwd_.at(nextBlock), jslvar, jslvar, 3, 3);
4222
4223 // copy variances from v_junctionVariancesFwd_ to v_AtVinv_
4224 AtVinv->copyelements(jsl, pseudomsrJSLBegin + paramCount,
4225 v_junctionVariancesFwd_.at(nextBlock), jslvar, jslvar, 3, 3);
4226
4227 // msr-comp elements
4228 // Measured-computed for junction stations carried forward (from thisBlock-1)
4229 // add station X measurement
4230 measMinusComp->put(pseudomsrJSLBegin + paramCount, 0,
4231 (v_junctionEstimatesFwd_.at(nextBlock).get(jslvar, 0) -
4232 estimatedStations->get(jsl, 0))); // X (meas - computed)
4233
4234 // add station Y measurement
4235 measMinusComp->put(pseudomsrJSLBegin + paramCount+1, 0,
4236 (v_junctionEstimatesFwd_.at(nextBlock).get(jslvar+1, 0) -
4237 estimatedStations->get(jsl+1, 0))); // Y (meas - computed)
4238
4239 // add station Z measurement
4240 measMinusComp->put(pseudomsrJSLBegin + paramCount+2, 0,
4241 (v_junctionEstimatesFwd_.at(nextBlock).get(jslvar+2, 0) -
4242 estimatedStations->get(jsl+2, 0))); // Z (meas - computed)
4243
4244 paramCount2 = 0;
4245
4246 // copy all covariances for this JSL in the next block
4247 for (_it_jsl_cov=_it_jsl;
4248 _it_jsl_cov!=v_JSL_.at(nextBlock).end();
4249 ++_it_jsl_cov, paramCount2+=3)
4250 {
4251 // don't re-copy variances (i.e. diagonals)
4252 if (*_it_jsl_cov == *_it_jsl)
4253 continue;
4254
4255 // get index of all covariances for this JSL in the next block
4256 jslcovar = static_cast<UINT32>(std::distance(v_JSL_.at(nextBlock).begin(), _it_jsl_cov) * 3);
4257 jsl_cov1 = v_blockStationsMap_.at(thisBlock)[*_it_jsl_cov] * 3;
4258
4259 // add covariances for this JSL to normals
4260 normals->blockadd(jsl_cov1, jsl, v_junctionVariancesFwd_.at(nextBlock), jslcovar, jslvar, 3, 3);
4261 normals->blockadd(jsl, jsl_cov1, v_junctionVariancesFwd_.at(nextBlock), jslvar, jslcovar, 3, 3);
4262
4263 // copy covariances from v_junctionVariancesFwd_ to v_AtVinv_
4264 AtVinv->copyelements(jsl_cov1, pseudomsrJSLBegin + paramCount,
4265 v_junctionVariancesFwd_.at(nextBlock), jslcovar, jslvar, 3, 3);
4266
4267 AtVinv->copyelements(jsl, pseudomsrJSLBegin + paramCount + paramCount2,
4268 v_junctionVariancesFwd_.at(nextBlock), jslvar, jslcovar, 3, 3);
4269 }
4270 }
4271
4272 if (projectSettings_.g.verbose > 0)
4273 {
4274 adj_file << std::endl << "Reverse block " << thisBlock;
4275 if (projectSettings_.a.stage)
4276 adj_file << " phased " << std::endl;
4277 else
4278 adj_file << " staged " << std::endl;
4279 adj_file << std::scientific << std::setprecision(16) <<
4280 "Design " << v_design_.at(thisBlock) << std::endl <<
4281 "AtVinv " << v_AtVinv_.at(thisBlock) << std::endl <<
4282 "Normals " << v_normals_.at(thisBlock) << std::endl;
4283 }
4284}

References adj_file, dynadjust::math::matrix_2d::blockadd(), dynadjust::math::matrix_2d::copyelements(), dynadjust::math::matrix_2d::get(), dynadjust::math::matrix_2d::grow(), projectSettings_, dynadjust::math::matrix_2d::put(), dynadjust::math::matrix_2d::rows(), v_AtVinv_, v_AtVinvR_, v_blockMeta_, v_blockStationsMap_, v_design_, v_estimatedStations_, v_estimatedStationsR_, v_JSL_, v_junctionEstimatesFwd_, v_junctionVariancesFwd_, v_measMinusComp_, v_measMinusCompR_, v_measurementParams_, v_normals_, v_normalsR_, and v_normalsRC_.

Referenced by PrepareAdjustmentCombine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateAtVinv()

void dynadjust::networkadjust::dna_adjust::UpdateAtVinv ( pit_vmsr_t _it_msr,
const UINT32 & stn1,
const UINT32 & stn2,
const UINT32 & stn3,
UINT32 & design_row,
matrix_2d * design,
matrix_2d * AtVinv,
bool buildnewMatrices = true )
private

Definition at line 1434 of file dnaadjust.cpp.

1436{
1437 // variance
1438 double variance(1./(*_it_msr)->term2);
1439
1440 if (buildnewMatrices)
1441 if (projectSettings_.g.verbose > 5)
1442 debug_file << "V" << (*_it_msr)->measType << " " <<
1443 std::fixed << std::setprecision(16) << std::setw(26) << variance << std::endl;
1444
1445 // Build At * V-1
1446 AtVinv->put(stn1, design_row, variance * design->get(design_row, stn1));
1447 AtVinv->put(stn1+1, design_row, variance * design->get(design_row, stn1+1));
1448 AtVinv->put(stn1+2, design_row, variance * design->get(design_row, stn1+2));
1449
1450 // Single station measurements
1451 switch ((*_it_msr)->measType)
1452 {
1453 case 'H': // Orthometric height
1454 case 'I': // Astronomic latitude
1455 case 'J': // Astronomic longitude
1456 case 'P': // Geodetic latitude
1457 case 'Q': // Geodetic longitude
1458 case 'R': // Ellipsoidal height
1459 return;
1460 }
1461
1462 // Two station measurements
1463 AtVinv->put(stn2, design_row, variance * design->get(design_row, stn2));
1464 AtVinv->put(stn2+1, design_row, variance * design->get(design_row, stn2+1));
1465 AtVinv->put(stn2+2, design_row, variance * design->get(design_row, stn2+2));
1466
1467 switch ((*_it_msr)->measType)
1468 {
1469 case 'A': // Horizontal angle
1470 AtVinv->put(stn3, design_row, variance * design->get(design_row, stn3));
1471 AtVinv->put(stn3+1, design_row, variance * design->get(design_row, stn3+1));
1472 AtVinv->put(stn3+2, design_row, variance * design->get(design_row, stn3+2));
1473 }
1474}

References debug_file, dynadjust::math::matrix_2d::get(), projectSettings_, and dynadjust::math::matrix_2d::put().

Referenced by UpdateDesignNormalMeasMatrices_A(), UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_CEM(), UpdateDesignNormalMeasMatrices_HR(), UpdateDesignNormalMeasMatrices_IP(), UpdateDesignNormalMeasMatrices_JQ(), UpdateDesignNormalMeasMatrices_L(), UpdateDesignNormalMeasMatrices_S(), UpdateDesignNormalMeasMatrices_V(), and UpdateDesignNormalMeasMatrices_Z().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateAtVinv_D()

void dynadjust::networkadjust::dna_adjust::UpdateAtVinv_D ( const UINT32 & stn1,
const UINT32 & stn2,
const UINT32 & stn3,
const UINT32 & angle,
const UINT32 & angle_count,
UINT32 & design_row,
UINT32 & design_row_begin,
matrix_2d * Vinv,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1477 of file dnaadjust.cpp.

1481{
1482 for (UINT32 j, i(0); i<3; ++i) // for each coordinate element (x, y, z)
1483 {
1484 // add variances
1485 AtVinv->elementadd(stn1+i, design_row, // station1
1486 design->get(design_row, stn1+i) * Vinv->get(angle, angle));
1487 AtVinv->elementadd(stn2+i, design_row, // station2
1488 design->get(design_row, stn2+i) * Vinv->get(angle, angle));
1489 AtVinv->elementadd(stn3+i, design_row, // station3
1490 design->get(design_row, stn3+i) * Vinv->get(angle, angle));
1491
1492 // add covariances
1493 for (j=0; j<angle_count; ++j)
1494 {
1495 if (j == angle)
1496 continue;
1497 AtVinv->elementadd(stn1+i, design_row_begin+j, // station1
1498 design->get(design_row, stn1+i) * Vinv->get(angle, j));
1499 AtVinv->elementadd(stn2+i, design_row_begin+j, // station2
1500 design->get(design_row, stn2+i) * Vinv->get(angle, j));
1501 AtVinv->elementadd(stn3+i, design_row_begin+j, // station3
1502 design->get(design_row, stn3+i) * Vinv->get(angle, j));
1503 }
1504 }
1505}

References dynadjust::math::matrix_2d::elementadd(), and dynadjust::math::matrix_2d::get().

Referenced by UpdateDesignNormalMeasMatrices_D().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals()

void dynadjust::networkadjust::dna_adjust::UpdateNormals ( const UINT32 & block,
bool MT_ReverseOrCombine )
private

Definition at line 1513 of file dnaadjust.cpp.

1514{
1515 UINT32 stn1, stn2, stn3, design_row(0);
1516
1517 it_vUINT32 _it_block_msr;
1518 it_vmsr_t _it_msr;
1519
1520 matrix_2d* normals(&v_normals_.at(block));
1521 matrix_2d* design(&v_design_.at(block));
1522 matrix_2d* AtVinv(&v_AtVinv_.at(block));
1523
1524 if (MT_ReverseOrCombine)
1525 {
1526 normals = &v_normalsR_.at(block);
1527 design = &v_designR_.at(block);
1528 AtVinv = &v_AtVinvR_.at(block);
1529 }
1530
1531 for (_it_block_msr=v_CML_.at(block).begin(); _it_block_msr!=v_CML_.at(block).end(); ++_it_block_msr)
1532 {
1533 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
1534 continue;
1535
1536 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
1537
1538 switch (_it_msr->measType)
1539 {
1540 case 'H': // Orthometric height
1541 case 'I': // Astronomic latitude
1542 case 'J': // Astronomic longitude
1543 case 'P': // Geodetic latitude
1544 case 'Q': // Geodetic longitude
1545 case 'R': // Ellipsoidal height
1546 UpdateNormals_HIJPQR(stn1, design_row, normals, design, AtVinv);
1547 break;
1548
1549 case 'A': // Horizontal angle
1550 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
1551 stn3 = GetBlkMatrixElemStn3(block, &_it_msr);
1552 UpdateNormals_A(stn1, stn2, stn3, design_row, normals, design, AtVinv);
1553 break;
1554
1555 case 'D': // Direction set
1556 // When a target direction is found, continue to next element.
1557 if (_it_msr->vectorCount1 < 1)
1558 continue;
1559 UpdateNormals_D(block, _it_msr, design_row, normals, design, AtVinv);
1560 break;
1561
1562 case 'B': // Geodetic azimuth
1563 case 'C': // Chord dist
1564 case 'E': // Ellipsoid arc
1565 case 'K': // Astronomic azimuth
1566 case 'L': // Level difference
1567 case 'M': // MSL arc
1568 case 'S': // Slope distance
1569 case 'V': // Zenith distance
1570 case 'Z': // Vertical angle
1571 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
1572 UpdateNormals_BCEKLMSVZ(stn1, stn2, design_row, normals, design, AtVinv);
1573 break;
1574
1575 case 'G': // GPS Baseline
1576 // multiplies only the elements of AT * V-1 and A that contain this measurement
1577 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
1578 UpdateNormals_G(stn1, stn2, design_row, normals, AtVinv);
1579 break;
1580
1581 case 'X': // GPS Baseline cluster
1582 UpdateNormals_X(block, _it_msr, design_row, normals, design, AtVinv);
1583 break;
1584
1585 case 'Y': // GPS Point cluster
1586 UpdateNormals_Y(block, _it_msr, design_row, normals, AtVinv);
1587 break;
1588
1589 default:
1590 std::stringstream ss;
1591 ss << "UpdateNormals(): Unknown measurement type - '" << static_cast<std::string>(&(_it_msr->measType)) <<
1592 "'." << std::endl;
1593 SignalExceptionAdjustment(ss.str(), block);
1594 }
1595 }
1596}
void UpdateNormals_Y(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, matrix_2d *normals, matrix_2d *AtVinv)
void UpdateNormals_X(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
bool InitialiseandValidateMsrPointer(const it_vUINT32 &_it_block_msr, it_vmsr_t &_it_msr)

References GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), GetBlkMatrixElemStn3(), InitialiseandValidateMsrPointer(), SignalExceptionAdjustment(), UpdateNormals_A(), UpdateNormals_BCEKLMSVZ(), UpdateNormals_D(), UpdateNormals_G(), UpdateNormals_HIJPQR(), UpdateNormals_X(), UpdateNormals_Y(), v_AtVinv_, v_AtVinvR_, v_CML_, v_design_, v_designR_, v_normals_, and v_normalsR_.

Referenced by RebuildNormals(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals_A()

void dynadjust::networkadjust::dna_adjust::UpdateNormals_A ( const UINT32 & stn1,
const UINT32 & stn2,
const UINT32 & stn3,
UINT32 & design_row,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1665 of file dnaadjust.cpp.

1667{
1668 // station 1
1669 AddMsrtoNormalsVar(design_row, stn1, normals, design, AtVinv);
1670 // station 2
1671 AddMsrtoNormalsVar(design_row, stn2, normals, design, AtVinv);
1672 // station 3
1673 AddMsrtoNormalsVar(design_row, stn3, normals, design, AtVinv);
1674 // covariance terms (station 1, station 2, station 3)
1675 AddMsrtoNormalsCoVar3(design_row, stn1, stn2, stn3, normals, design, AtVinv);
1676 design_row ++;
1677
1678}
void AddMsrtoNormalsVar(const UINT32 &design_row, const UINT32 &stn, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)
void AddMsrtoNormalsCoVar3(const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)

References AddMsrtoNormalsCoVar3(), and AddMsrtoNormalsVar().

Referenced by UpdateDesignNormalMeasMatrices_A(), and UpdateNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals_BCEKLMSVZ()

void dynadjust::networkadjust::dna_adjust::UpdateNormals_BCEKLMSVZ ( const UINT32 & stn1,
const UINT32 & stn2,
UINT32 & design_row,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1802 of file dnaadjust.cpp.

1804{
1805 // station 1
1806 AddMsrtoNormalsVar(design_row, stn1, normals, design, AtVinv);
1807 // station 2
1808 AddMsrtoNormalsVar(design_row, stn2, normals, design, AtVinv);
1809 // covariance terms (station 1 and station 2)
1810 AddMsrtoNormalsCoVar2(design_row, stn1, stn2, normals, design, AtVinv);
1811 design_row ++;
1812}
void AddMsrtoNormalsCoVar2(const UINT32 &design_row, const UINT32 &stn1, const UINT32 &stn2, matrix_2d *normals, matrix_2d *design, matrix_2d *AtVinv)

References AddMsrtoNormalsCoVar2(), and AddMsrtoNormalsVar().

Referenced by UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_CEM(), UpdateDesignNormalMeasMatrices_L(), UpdateDesignNormalMeasMatrices_S(), UpdateDesignNormalMeasMatrices_V(), UpdateDesignNormalMeasMatrices_Z(), and UpdateNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals_HIJPQR()

void dynadjust::networkadjust::dna_adjust::UpdateNormals_HIJPQR ( const UINT32 & stn1,
UINT32 & design_row,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1816 of file dnaadjust.cpp.

1818{
1819 // station 1
1820 AddMsrtoNormalsVar(design_row, stn1, normals, design, AtVinv);
1821 design_row ++;
1822}

References AddMsrtoNormalsVar().

Referenced by UpdateDesignNormalMeasMatrices_HR(), UpdateDesignNormalMeasMatrices_IP(), UpdateDesignNormalMeasMatrices_JQ(), and UpdateNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals_D()

void dynadjust::networkadjust::dna_adjust::UpdateNormals_D ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1681 of file dnaadjust.cpp.

1683{
1684 UINT32 row, col, a, angle_count(_it_msr->vectorCount2 - 1);
1685 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
1686
1687 std::vector<UINT32> stations;
1688 UINT32 stn1, stn2, stn3;
1689
1690 vmsr_t angleRec;
1691 angleRec.push_back(*_it_msr);
1692 it_vmsr_t it_angle(angleRec.begin());
1693
1694 _it_msr++;
1695
1696 // Build At * V-1 * A variances and form list of
1697 // stations to assist formulation of covariances
1698 for (a=0; a<angle_count; ++a) // for each angle
1699 {
1700 // cater for ignored directions
1701 if (_it_msr->ignore)
1702 {
1703 while (skip < ignored)
1704 {
1705 skip++;
1706 _it_msr++;
1707 if (!_it_msr->ignore)
1708 break;
1709 }
1710 }
1711
1712 it_angle->station3 = _it_msr->station2;
1713
1714 stn1 = (v_blockStationsMap_.at(block)[it_angle->station1] * 3);
1715 stn2 = (v_blockStationsMap_.at(block)[it_angle->station2] * 3);
1716 stn3 = (v_blockStationsMap_.at(block)[it_angle->station3] * 3);
1717
1718 if (!binary_search(stations.begin(), stations.end(), it_angle->station1))
1719 {
1720 stations.push_back(it_angle->station1);
1721 std::sort(stations.begin(), stations.end());
1722 }
1723 if (!binary_search(stations.begin(), stations.end(), it_angle->station2))
1724 {
1725 stations.push_back(it_angle->station2);
1726 std::sort(stations.begin(), stations.end());
1727 }
1728 if (!binary_search(stations.begin(), stations.end(), it_angle->station3))
1729 {
1730 stations.push_back(it_angle->station3);
1731 std::sort(stations.begin(), stations.end());
1732 }
1733
1734 // station 1
1735 for (col=0; col<3; ++col)
1736 for (row=0; row<3; ++row)
1737 normals->elementadd(stn1+row, stn1+col,
1738 AtVinv->get(stn1+row, design_row+a) * design->get(design_row+a, stn1+col));
1739 //
1740 // station 2
1741 for (col=0; col<3; ++col)
1742 for (row=0; row<3; ++row)
1743 normals->elementadd(stn2+row, stn2+col,
1744 AtVinv->get(stn2+row, design_row+a) * design->get(design_row+a, stn2+col));
1745 //
1746 // station 3
1747 for (col=0; col<3; ++col)
1748 for (row=0; row<3; ++row)
1749 normals->elementadd(stn3+row, stn3+col,
1750 AtVinv->get(stn3+row, design_row+a) * design->get(design_row+a, stn3+col));
1751
1752 if (a+1 == angle_count)
1753 break;
1754
1755 // prepare for next angle
1756 angleRec.push_back(*_it_msr);
1757 it_angle = angleRec.end() - 1;
1758
1759 _it_msr++;
1760 }
1761
1762 it_vUINT32 it_stn, it_cov;
1763 it_angle = angleRec.begin();
1764
1765 // Build At * V-1 * A covariances
1766 for (a=0; a<angle_count; ++a) // for each angle
1767 {
1768 //
1769 // covariance terms (station 1, station 2, station 3)
1770 // requires std::vector<UINT32> stations which was built during formation of v_AtVinv_
1771 for (it_stn=stations.begin(); it_stn!=stations.end(); ++it_stn)
1772 {
1773 stn1 = (v_blockStationsMap_.at(block)[*it_stn] * 3);
1774
1775 for (it_cov=it_stn; it_cov!=stations.end(); ++it_cov)
1776 {
1777 stn2 = (v_blockStationsMap_.at(block)[*it_cov] * 3);
1778 if (stn2 == stn1)
1779 continue;
1780
1781 for (col=0; col<3; ++col)
1782 {
1783 for (row=0; row<3; ++row)
1784 {
1785 // 1-2
1786 normals->elementadd(stn1+row, stn2+col,
1787 AtVinv->get(stn1+row, design_row+a) * design->get(design_row+a, stn2+col));
1788 normals->elementadd(stn2+row, stn1+col,
1789 AtVinv->get(stn2+row, design_row+a) * design->get(design_row+a, stn1+col));
1790 }
1791 }
1792 }
1793 }
1794 it_angle++;
1795 }
1796
1797 design_row += angle_count;
1798}

References dynadjust::math::matrix_2d::elementadd(), dynadjust::math::matrix_2d::get(), and v_blockStationsMap_.

Referenced by UpdateDesignNormalMeasMatrices_D(), and UpdateNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals_G()

void dynadjust::networkadjust::dna_adjust::UpdateNormals_G ( const UINT32 & stn1,
const UINT32 & stn2,
UINT32 & design_row,
matrix_2d * normals,
matrix_2d * AtVinv )
private

Definition at line 1825 of file dnaadjust.cpp.

1827{
1828 UINT32 col, row;
1829
1830 // station 2
1831 for (col=0; col<3; ++col)
1832 for (row=0; row<3; ++row)
1833 normals->elementadd(stn2+row, stn2+col,
1834 // AtVinv->get(stn2+row, design_row+col) * design->get(design_row+col, stn2+col));
1835 // No need to multiply by 1 as stn2 design element is always 1. See UpdateDesignMeasMatrices_GX()
1836 AtVinv->get(stn2+row, design_row+col));
1837
1838 // station 1
1839 for (col=0; col<3; ++col)
1840 for (row=0; row<3; ++row)
1841 normals->elementadd(stn1+row, stn1+col,
1842 // AtVinv->get(stn1+row, design_row+col) * design->get(design_row+col, stn1+col));
1843 // No need to multiply by -1 as stn1 design element is always -1. See UpdateDesignMeasMatrices_GX()
1844 -AtVinv->get(stn1+row, design_row+col));
1845
1846 // covariance terms (station 1 and station 2)
1847 for (col=0; col<3; ++col)
1848 for (row=0; row<3; ++row)
1849 normals->elementadd(stn1+row, stn2+col,
1850 // AtVinv->get(stn1+row, design_row+col) * design->get(design_row+col, stn2+col));
1851 // No need to multiply as stn2 is always 1. See UpdateDesignMeasMatrices_GX()
1852 AtVinv->get(stn1+row, design_row+col));
1853
1854 // covariance terms (station 2 and station 1)
1855 for (col=0; col<3; ++col)
1856 for (row=0; row<3; ++row)
1857 normals->elementadd(stn2+row, stn1+col,
1858 // AtVinv->get(stn2+row, design_row+col) * design->get(design_row+col, stn1+col));
1859 // No need to multiply by -1 as stn1 design element is always -1. See UpdateDesignMeasMatrices_GX()
1860 -AtVinv->get(stn2+row, design_row+col));
1861
1862 design_row += 3;
1863}

References dynadjust::math::matrix_2d::elementadd(), and dynadjust::math::matrix_2d::get().

Referenced by UpdateDesignNormalMeasMatrices_G(), and UpdateNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals_X()

void dynadjust::networkadjust::dna_adjust::UpdateNormals_X ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
matrix_2d * normals,
matrix_2d * design,
matrix_2d * AtVinv )
private

Definition at line 1866 of file dnaadjust.cpp.

1868{
1869 UINT32 cluster_bsl, baseline_count(_it_msr->vectorCount1);
1870 UINT32 cluster_cov, covariance_count;
1871 UINT32 stn1, stn2, covr(0);
1872
1873 vUINT32 baseline_stations;
1874
1875 baseline_stations.push_back(GetBlkMatrixElemStn1(block, &_it_msr));
1876 baseline_stations.push_back(GetBlkMatrixElemStn2(block, &_it_msr));
1877 std::sort(baseline_stations.begin(), baseline_stations.end());
1878
1879 matrix_2d tmp(3, 3);
1880
1881 // Build At * V-1 * A variances
1882 for (cluster_bsl=0; cluster_bsl<baseline_count; ++cluster_bsl)
1883 {
1884 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
1885 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
1886
1887 // create a unique list of stations used in this cluster
1888 if (!binary_search(baseline_stations.begin(), baseline_stations.end(), stn1))
1889 {
1890 baseline_stations.push_back(stn1);
1891 std::sort(baseline_stations.begin(), baseline_stations.end());
1892 }
1893
1894 if (!binary_search(baseline_stations.begin(), baseline_stations.end(), stn2))
1895 {
1896 baseline_stations.push_back(stn2);
1897 std::sort(baseline_stations.begin(), baseline_stations.end());
1898 }
1899
1900 covr = cluster_bsl * 3;
1901
1902 // add variances for these stations
1903 //normals->blockadd(stn1, stn1, // Station 1. This variance matrix
1904 // AtVinv->submatrix(stn1, // component must be multiplied by -1 to
1905 // design_row+covr, 3, 3).scale(-1.), 0, 0, 3, 3); // effect the design matrix elements
1906
1907 // copy the relevant AtV-1 elements to temp and multiply
1908 // by -1 to effect the design matrix elements
1909 AtVinv->submatrix(stn1, design_row+covr, &tmp, 3, 3);
1910 tmp.scale(-1.);
1911
1912 // add variances for these stations
1913 normals->blockadd(stn1, stn1, // Station 1.
1914 tmp, 0, 0, 3, 3);
1915 normals->blockadd(stn2, stn2, // Station 2
1916 *AtVinv, stn2, design_row+covr, 3, 3);
1917
1918 covariance_count = _it_msr->vectorCount2;
1919 _it_msr += 3; // move to covariances
1920
1921 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov)
1922 _it_msr += 3;
1923 }
1924
1925 matrix_2d tmp1(3, baseline_count*3), tmp2(baseline_count*3, 3);
1926
1927 // Build At * V-1 * A covariances
1928 for (cluster_bsl=0; cluster_bsl<baseline_stations.size(); ++cluster_bsl)
1929 {
1930 stn1 = baseline_stations.at(cluster_bsl);
1931
1932 for (cluster_cov=0; cluster_cov<baseline_stations.size(); ++cluster_cov)
1933 {
1934 if (cluster_cov==cluster_bsl)
1935 continue;
1936
1937 stn2 = baseline_stations.at(cluster_cov);
1938
1940 //normals->blockadd(stn1, stn2,
1941 // AtVinv->submatrix(stn1,
1942 // design_row, 3, baseline_count*3).multiply(
1943 // design->submatrix(design_row, stn2,
1944 // baseline_count*3, 3)), 0, 0, 3, 3);
1945
1946 // The following is more code, but is more efficient as it
1947 // recycles matrix instances (as opposed to creating a
1948 // new instance for every call to submatrix and multiply)
1949 // Get AtVinv component
1950 AtVinv->submatrix(stn1, design_row,
1951 &tmp1, 3, baseline_count*3);
1952 // Get design component
1953 design->submatrix(design_row, stn2,
1954 &tmp2, baseline_count*3, 3);
1955 // multiply the components to form covariance
1956 // for stations stn1 and stn2
1957 //tmp.multiply(tmp1, tmp2);
1958 tmp.multiply(tmp1, "N", tmp2, "N");
1959 // Now add covariances to normals
1960 normals->blockadd(stn1, stn2,
1961 tmp, 0, 0, 3, 3);
1962 }
1963 }
1964
1965 design_row += baseline_count * 3;
1966}

References dynadjust::math::matrix_2d::blockadd(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), dynadjust::math::matrix_2d::multiply(), dynadjust::math::matrix_2d::scale(), and dynadjust::math::matrix_2d::submatrix().

Referenced by UpdateNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormals_Y()

void dynadjust::networkadjust::dna_adjust::UpdateNormals_Y ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
matrix_2d * normals,
matrix_2d * AtVinv )
private

Definition at line 1969 of file dnaadjust.cpp.

1971{
1972 UINT32 cluster_pnt, point_count(_it_msr->vectorCount1);
1973 UINT32 cluster_cov, covariance_count;
1974 UINT32 stn1, stn2, cov_c;
1975
1976 // Add to At * V-1 * A
1977 for (cluster_pnt=0; cluster_pnt<point_count; ++cluster_pnt)
1978 {
1979 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
1980 covariance_count = _it_msr->vectorCount2;
1981
1982 // add variance for this station
1983 normals->blockadd(stn1, stn1, *AtVinv, stn1, design_row, 3, 3);
1984
1985 if (projectSettings_.g.verbose > 4)
1986 debug_file << "- Adding variances for " << bstBinaryRecords_.at(_it_msr->station1).stationName << " to v_normals_ (block " << block+1 << "), (" << stn1 << ", " << stn1 << "): " <<
1987 std::fixed << std::setprecision(16) << AtVinv->submatrix(stn1, design_row, 3, 3);
1988
1989 if (covariance_count < 1)
1990 {
1991 design_row += 3;
1992 break;
1993 }
1994
1995 _it_msr += 3;
1996 cov_c = 0;
1997
1998 for (cluster_cov=0; cluster_cov<covariance_count; ++cluster_cov) // number of baseline/point covariances
1999 {
2000 stn2 = GetBlkMatrixElemStn1(block, &_it_msr); // this becomes stn1 in next cluster_pnt loop
2001 cov_c += 3;
2002
2003 // add covariance between stn1 and this station
2004 normals->blockadd(stn1, stn2, *AtVinv, stn1, design_row + cov_c, 3, 3);
2005 normals->blockadd(stn2, stn1, *AtVinv, stn2, design_row, 3, 3);
2006
2007 _it_msr += 3;
2008 }
2009 design_row += 3;
2010 }
2011}

References dynadjust::math::matrix_2d::blockadd(), bstBinaryRecords_, debug_file, GetBlkMatrixElemStn1(), projectSettings_, and dynadjust::math::matrix_2d::submatrix().

Referenced by UpdateNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OutputLargestCorrection()

void dynadjust::networkadjust::dna_adjust::OutputLargestCorrection ( std::string & formatted_msg)
private

Definition at line 8329 of file dnaadjust.cpp.

8330{
8331 UINT32 stnIndex(0), x_coordElement(0);
8332
8333 // load corrections matrix for block blockLargeCorr_
8334 if (projectSettings_.a.stage)
8337
8338 // print maximum correction
8339 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Maximum station correction";
8340
8341 // which station?
8342 stnIndex = (UINT32)floor(v_corrections_.at(blockLargeCorr_).maxvalueRow() / 3.);
8343 stnIndex = v_parameterStationList_.at(blockLargeCorr_).at(stnIndex);
8344 x_coordElement = (UINT32)(v_corrections_.at(blockLargeCorr_).maxvalueRow() % 3);
8345
8346 switch (projectSettings_.a.adjust_mode)
8347 {
8348 case Phased_Block_1Mode:
8349 case PhasedMode:
8350 adj_file << "Block " << blockLargeCorr_+1 <<
8351 ", station " << bstBinaryRecords_.at(stnIndex).stationName;
8352 break;
8353 case SimultaneousMode:
8354 default:
8355 adj_file << "Station " << bstBinaryRecords_.at(stnIndex).stationName;
8356 break;
8357 }
8358
8359 adj_file << std::endl << std::setw(PRINT_VAR_PAD) << " ";
8360
8361 // calculate error vector in local reference frame
8362 matrix_2d cart(3, 1), local(3, 1);
8363 switch (x_coordElement)
8364 {
8365 case 0:
8366 x_coordElement = v_corrections_.at(blockLargeCorr_).maxvalueRow();
8367 break;
8368 case 1:
8369 x_coordElement = v_corrections_.at(blockLargeCorr_).maxvalueRow() - 1;
8370 break;
8371 case 2:
8372 x_coordElement = v_corrections_.at(blockLargeCorr_).maxvalueRow() - 2;
8373 break;
8374 }
8375
8376 cart.put(0, 0, v_corrections_.at(blockLargeCorr_).get(x_coordElement, 0));
8377 cart.put(1, 0, v_corrections_.at(blockLargeCorr_).get(x_coordElement+1, 0));
8378 cart.put(2, 0, v_corrections_.at(blockLargeCorr_).get(x_coordElement+2, 0));
8379
8380 // OK, finished with the corrections, so unload if staged
8381 if (projectSettings_.a.stage)
8383
8384 Rotate_CartLocal<double>(cart, &local,
8385 bstBinaryRecords_.at(stnIndex).currentLatitude,
8386 bstBinaryRecords_.at(stnIndex).currentLongitude);
8387
8388 double largestCorr = local.compute_maximum_value();
8389
8390 if (fabs(largestCorr) > 0.000999)
8391 adj_file << std::fixed << std::setprecision(3) <<
8392 local.get(0, 0) << ", " << local.get(1, 0) << ", " << local.get(2, 0);
8393 else if (fabs(largestCorr) > 0.00009)
8394 adj_file << std::fixed << std::setprecision(4) <<
8395 local.get(0, 0) << ", " << local.get(1, 0) << ", " << local.get(2, 0);
8396 else
8397 adj_file << std::scientific << std::setprecision(1) <<
8398 local.get(0, 0) << ", " << local.get(1, 0) << ", " << local.get(2, 0);
8399
8400
8401 adj_file << " (e, n, up)" << std::endl << std::endl;
8402
8403 std::stringstream ss;
8404 ss << std::fixed << std::setprecision(PRECISION_MTR_STN) << local.get(local.maxvalueRow(), 0) << " ";
8405
8406 switch (local.maxvalueRow())
8407 {
8408 case 0:
8409 ss << std::setw(2) << std::left << "e";
8410 break;
8411 case 1:
8412 ss << std::setw(2) << std::left << "n";
8413 break;
8414 case 2:
8415 ss << std::setw(2) << std::left << "up";
8416 break;
8417 }
8418
8419 formatted_msg = ss.str();
8420}
void Rotate_CartLocal(const matrix_2d mvector, matrix_2d *mvector_mod, const T &latitude, const T &longitude)

References adj_file, blockLargeCorr_, bstBinaryRecords_, dynadjust::math::matrix_2d::compute_maximum_value(), DeserialiseBlockFromMappedFile(), dynadjust::math::matrix_2d::get(), dynadjust::math::matrix_2d::maxvalueRow(), Phased_Block_1Mode, PhasedMode, PRECISION_MTR_STN, PRINT_VAR_PAD(), projectSettings_, Rotate_CartLocal(), sf_corrections, SimultaneousMode, UnloadBlock(), v_corrections_, and v_parameterStationList_.

Referenced by AdjustPhased(), AdjustPhasedBlock1(), AdjustPhasedMultiThread(), and AdjustSimultaneous().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareDesignAndMsrMnsCmpMatrices()

void dynadjust::networkadjust::dna_adjust::PrepareDesignAndMsrMnsCmpMatrices ( const UINT32 & block)
private

Definition at line 982 of file dnaadjust.cpp.

983{
984 UINT32 pseudoMsrElemCount(0), pseudoMsrCount(0);
985
986 switch (projectSettings_.a.adjust_mode)
987 {
988 case SimultaneousMode:
989
990 // redimension the measurements matrix
991 v_measMinusComp_.at(block).redim(
992 v_measurementCount_.at(block), 1);
993
994 // redimension the At*V-1 matrix
995 v_AtVinv_.at(block).redim(
996 v_unknownsCount_.at(block),
997 v_measurementCount_.at(block));
998
999 break;
1000 case Phased_Block_1Mode:
1001 case PhasedMode:
1002 // Phased mode also includes sequential phased adjustment in
1003 // stage and multi-thread mode
1004
1005 // Prepare all blocks except the first and any isolated blocks
1006 if (!v_blockMeta_.at(block)._blockIsolated)
1007 {
1008 // During forward and reverse (in isolation) adjustments, this block will include
1009 // JSLs as measurements from either v_JSL_.at(block-1) or v_JSL_.at(block).
1010 // During combination adjustments, this block will include JSLs as measurements
1011 // from both. So set pseudomsrJSLCount to be the sum of both and grow/shrink accordingly
1012 pseudoMsrCount = static_cast<UINT32>(v_JSL_.at(block).size());
1013
1014 if (!v_blockMeta_.at(block)._blockFirst)
1015 pseudoMsrCount += static_cast<UINT32>(v_JSL_.at(block-1).size());
1016
1017 pseudoMsrElemCount = pseudoMsrCount * 3;
1018 }
1019
1020 // Is this a staged adjustment for which the matrix data is to be loaded from
1021 // existing stage files created from a previous run?
1022 if (projectSettings_.a.stage)
1023 {
1024 // Staged adjustments only.
1025 // Load matrix data from existing .mtx stage files
1026 // created from a previous run.
1027
1028 // redimension the measurements matrix
1029 if (projectSettings_.a.recreate_stage_files)
1030 v_measMinusComp_.at(block).redim(
1031 v_measurementCount_.at(block) + pseudoMsrElemCount, 1); // real measurements + JSLs (fwd + reverse)
1032 else
1033 v_measMinusComp_.at(block).setsize(
1034 v_measurementCount_.at(block) + pseudoMsrElemCount, 1);
1035
1036 // redimension the At*V-1 matrix
1037 v_AtVinv_.at(block).setsize(
1038 v_unknownsCount_.at(block),
1039 v_measurementCount_.at(block) + pseudoMsrElemCount); // real measurements + JSLs (fwd + reverse)
1040 }
1041 else
1042 {
1043 // redimension the measurements matrix
1044 v_measMinusComp_.at(block).redim(
1045 v_measurementCount_.at(block) + pseudoMsrElemCount, 1); // real measurements + JSLs (fwd + reverse)
1046
1047 // redimension the At*V-1 matrix
1048 v_AtVinv_.at(block).redim(
1049 v_unknownsCount_.at(block),
1050 v_measurementCount_.at(block) + pseudoMsrElemCount); // real measurements + JSLs (fwd + reverse)
1051 }
1052
1053 if (pseudoMsrElemCount > 0)
1054 {
1055 // Now reset these matrices back to actual measurement dimensions.
1056 // The forward, reverse and combination pass will use grow() to incorporate
1057 // JSLs from previous and next blocks as required
1058 v_AtVinv_.at(block).shrink(0, pseudoMsrElemCount);
1059 v_measMinusComp_.at(block).shrink(pseudoMsrElemCount, 0);
1060 }
1061
1062 // Store pseudo measurement count
1063 v_pseudoMeasCountFwd_.at(block) = pseudoMsrCount;
1064 }
1065
1066 // Is this a phased adjustment in stage mode?
1067 if (projectSettings_.a.stage)
1068 {
1070 return;
1071 }
1072
1073 // Simultaneous, phased (multithreaded and block1) adjustments
1074
1075 // Redim all matrices
1076 v_normals_.at(block).redim(v_unknownsCount_.at(block), v_unknownsCount_.at(block));
1077 v_design_.at(block).redim(v_measurementCount_.at(block), v_unknownsCount_.at(block));
1078 v_corrections_.at(block).redim(v_unknownsCount_.at(block), 1);
1079 v_precAdjMsrsFull_.at(block).redim(v_measurementVarianceCount_.at(block), 1);
1080
1081 // All blocks in v_correctionsR_ are used for multi thread mode, but only the last is used
1082 // in single thread mode
1083 if (projectSettings_.a.adjust_mode == PhasedMode &&
1084 projectSettings_.a.adjust_mode != Phased_Block_1Mode)
1085 {
1086 if (v_blockMeta_.at(block)._blockLast)
1087 v_correctionsR_.at(block).redim(v_unknownsCount_.at(block), 1);
1088
1089 else if (projectSettings_.a.multi_thread)
1090 v_correctionsR_.at(block).redim(v_unknownsCount_.at(block), 1);
1091 }
1092
1093
1094 // Now, form the design matrices
1095 FillDesignNormalMeasurementsMatrices(true, block, false);
1096
1097}
void PrepareDesignAndMsrMnsCmpMatricesStage(const UINT32 &block)

References FillDesignNormalMeasurementsMatrices(), Phased_Block_1Mode, PhasedMode, PrepareDesignAndMsrMnsCmpMatricesStage(), projectSettings_, SimultaneousMode, v_AtVinv_, v_blockMeta_, v_corrections_, v_correctionsR_, v_design_, v_JSL_, v_measMinusComp_, v_measurementCount_, v_measurementVarianceCount_, v_normals_, v_precAdjMsrsFull_, v_pseudoMeasCountFwd_, and v_unknownsCount_.

Referenced by PrepareAdjustmentBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareDesignAndMsrMnsCmpMatricesStage()

void dynadjust::networkadjust::dna_adjust::PrepareDesignAndMsrMnsCmpMatricesStage ( const UINT32 & block)
private

Definition at line 1100 of file dnaadjust.cpp.

1101{
1102 // Resize all matrices, which will be filled as and when needed
1103 v_normals_.at(block).setsize(v_unknownsCount_.at(block), v_unknownsCount_.at(block));
1104 v_design_.at(block).setsize(v_measurementCount_.at(block), v_unknownsCount_.at(block));
1105
1106 // Does the matrix data need to be loaded from existing stage files
1107 // created from a previous run?
1108 if (projectSettings_.a.recreate_stage_files || !bms_meta_.reduced)
1109 {
1110 // Redim NormalsR
1111 v_normalsR_.at(block).redim(
1112 v_unknownsCount_.at(block),
1113 v_unknownsCount_.at(block));
1114
1115 // Redimension the corrections matrices
1116 v_corrections_.at(block).redim(v_unknownsCount_.at(block), 1);
1117 if (v_blockMeta_.at(block)._blockLast)
1118 v_correctionsR_.at(block).redim(v_unknownsCount_.at(block), 1);
1119
1120 // Redimension precision of adjusted measurements
1121 v_precAdjMsrsFull_.at(block).redim(v_measurementVarianceCount_.at(block), 1);
1122 }
1123 else
1124 {
1125 // Resize the normals back-up matrix
1126 v_normalsR_.at(block).setsize(
1127 v_unknownsCount_.at(block),
1128 v_unknownsCount_.at(block));
1129
1130 // Resize the corrections matrices
1131 v_corrections_.at(block).setsize(v_unknownsCount_.at(block), 1);
1132 if (v_blockMeta_.at(block)._blockLast)
1133 v_correctionsR_.at(block).setsize(v_unknownsCount_.at(block), 1);
1134
1135 // Resize precision of adjusted measurements
1136 v_precAdjMsrsFull_.at(block).setsize(v_measurementVarianceCount_.at(block), 1);
1137 }
1138
1139 if (projectSettings_.a.recreate_stage_files || !bms_meta_.reduced)
1140 // Creating new memory mapped files? Form the design matrices
1141 FillDesignNormalMeasurementsMatrices(true, block, false);
1142}

References bms_meta_, FillDesignNormalMeasurementsMatrices(), projectSettings_, v_blockMeta_, v_corrections_, v_correctionsR_, v_design_, v_measurementCount_, v_measurementVarianceCount_, v_normals_, v_normalsR_, v_precAdjMsrsFull_, and v_unknownsCount_.

Referenced by PrepareDesignAndMsrMnsCmpMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FillDesignNormalMeasurementsMatrices()

void dynadjust::networkadjust::dna_adjust::FillDesignNormalMeasurementsMatrices ( bool buildnewMatrices,
const UINT32 & block,
bool MT_ReverseOrCombine )
private

Definition at line 4824 of file dnaadjust.cpp.

4825{
4826 UINT32 design_row(0);
4827
4828 it_vUINT32 _it_block_msr;
4829 it_vmsr_t _it_msr;
4830
4831 for (_it_block_msr=v_CML_.at(block).begin(); _it_block_msr!=v_CML_.at(block).end(); ++_it_block_msr)
4832 {
4833 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
4834 continue;
4835
4836 // When a target direction is found, continue to next element.
4837 if (_it_msr->measType == 'D')
4838 if (_it_msr->vectorCount2 < 1)
4839 continue;
4840
4841 // Build AtVinv, Normals and Meas minus Comp vectors
4842 UpdateDesignNormalMeasMatrices(&_it_msr, design_row, buildnewMatrices, block, MT_ReverseOrCombine);
4843 }
4844}
void UpdateDesignNormalMeasMatrices(pit_vmsr_t _it_msr, UINT32 &design_row, bool buildnewMatrices, const UINT32 &block, bool MT_ReverseOrCombine)

References InitialiseandValidateMsrPointer(), UpdateDesignNormalMeasMatrices(), and v_CML_.

Referenced by ComputeAdjustedMsrPrecisions(), PrepareDesignAndMsrMnsCmpMatrices(), PrepareDesignAndMsrMnsCmpMatricesStage(), RebuildNormals(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddConstraintStationstoNormalsForward()

void dynadjust::networkadjust::dna_adjust::AddConstraintStationstoNormalsForward ( const UINT32 & block)
private

Definition at line 2063 of file dnaadjust.cpp.

2064{
2065 it_vUINT32 _it_const;
2066 it_vstn_appear _it_appear;
2067
2068 UINT32 stn;
2069 matrix_2d var_cart(3, 3);
2070
2071 for (_it_const=v_parameterStationList_.at(block).begin(),
2072 _it_appear=v_paramStnAppearance_.at(block).begin();
2073 _it_const!=v_parameterStationList_.at(block).end();
2074 ++_it_const, ++_it_appear)
2075 {
2076
2077 // In phased adjustment mode, parameter station variances only
2078 // need to be added once
2079 if (!_it_appear->first_appearance_fwd)
2080 continue;
2081
2082 // compute _var_cart for this station
2083 FormConstraintStationVarianceMatrix(_it_const, var_cart);
2084
2085 if (projectSettings_.g.verbose > 6)
2086 debug_file << "parameter station " << bstBinaryRecords_.at((*_it_const)).stationName << std::scientific << std::setprecision(16) << var_cart << std::endl;
2087
2088 // Add the variance to the normals
2089 stn = v_blockStationsMap_.at(block)[(*_it_const)] * 3;
2090 v_normals_.at(block).blockadd(stn, stn, var_cart, 0, 0, 3, 3);
2091 }
2092}
void FormConstraintStationVarianceMatrix(const it_vUINT32 &_it_param_stn, matrix_2d &var_cart)

References bstBinaryRecords_, debug_file, FormConstraintStationVarianceMatrix(), projectSettings_, v_blockStationsMap_, v_normals_, v_parameterStationList_, and v_paramStnAppearance_.

Referenced by PrepareAdjustmentBlock(), RebuildNormals(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddConstraintStationstoNormalsReverse()

void dynadjust::networkadjust::dna_adjust::AddConstraintStationstoNormalsReverse ( const UINT32 & block,
bool MT_ReverseOrCombine )
private

Definition at line 2100 of file dnaadjust.cpp.

2101{
2102 it_vUINT32 _it_const;
2103 it_vstn_appear _it_appear;
2104
2105 UINT32 stn;
2106 matrix_2d var_cart(3, 3);
2107 matrix_2d* normals(&v_normals_.at(block));
2108
2109 if (MT_ReverseOrCombine)
2110 normals = &v_normalsR_.at(block);
2111
2112 for (_it_const=v_parameterStationList_.at(block).begin(),
2113 _it_appear=v_paramStnAppearance_.at(block).begin();
2114 _it_const!=v_parameterStationList_.at(block).end();
2115 ++_it_const, ++_it_appear)
2116 {
2117 // In phased adjustment mode, parameter station variances only
2118 // need to be added once
2119 if (!_it_appear->first_appearance_rev)
2120 continue;
2121
2122 // compute _var_cart for this station
2123 FormConstraintStationVarianceMatrix(_it_const, var_cart);
2124
2125 // Add the variance to the normals
2126 stn = v_blockStationsMap_.at(block)[(*_it_const)] * 3;
2127 normals->blockadd(stn, stn, var_cart, 0, 0, 3, 3);
2128 }
2129}

References dynadjust::math::matrix_2d::blockadd(), FormConstraintStationVarianceMatrix(), v_blockStationsMap_, v_normals_, v_normalsR_, v_parameterStationList_, and v_paramStnAppearance_.

Referenced by CarryReverseJunctions(), PrepareAdjustmentReverse(), and RebuildNormals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddConstraintStationstoNormalsCombine()

void dynadjust::networkadjust::dna_adjust::AddConstraintStationstoNormalsCombine ( const UINT32 & block,
bool MT_ReverseOrCombine )
private

Definition at line 2137 of file dnaadjust.cpp.

2138{
2139 it_vUINT32 _it_const;
2140 it_vstn_appear _it_appear;
2141
2142 UINT32 stn;
2143 matrix_2d var_cart(3, 3);
2144 matrix_2d* normals(&v_normals_.at(block));
2145
2146 if (MT_ReverseOrCombine)
2147 normals = &v_normalsR_.at(block);
2148
2149 for (_it_const=v_parameterStationList_.at(block).begin(),
2150 _it_appear=v_paramStnAppearance_.at(block).begin();
2151 _it_const!=v_parameterStationList_.at(block).end();
2152 ++_it_const, ++_it_appear)
2153 {
2154
2155 // In combination adjustment, parameter station variances only need to be added
2156 // if this station appears for the first time in both forward and reverse runs,
2157 // and subtracted if it appears for the first time in reverse but not in forward
2158
2159 // If this station appears for the first time in a forward pass, then
2160 // constraints have not yet been added for this station in the forward pass.
2161 // So, continue to the next station (do nothing)
2162 if (_it_appear->first_appearance_fwd)
2163 continue;
2164
2165 // At this point, this station has appeared in a previous block in a forward pass,
2166 // in which case, constraints would have been added and the effect carried through.
2167 // So, remove the effect.
2168
2169 // compute _var_cart for this station
2170 FormConstraintStationVarianceMatrix(_it_const, var_cart);
2171
2172 // Add the variance to the normals
2173 stn = v_blockStationsMap_.at(block)[(*_it_const)] * 3;
2174
2175 if (!_it_appear->first_appearance_fwd)
2176 normals->blocksubtract(stn, stn, var_cart,
2177 0, 0, 3, 3);
2178 }
2179}

References dynadjust::math::matrix_2d::blocksubtract(), FormConstraintStationVarianceMatrix(), v_blockStationsMap_, v_normals_, v_normalsR_, v_parameterStationList_, and v_paramStnAppearance_.

Referenced by PrepareAdjustmentCombine().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddConstraintStationstoNormalsSimultaneous()

void dynadjust::networkadjust::dna_adjust::AddConstraintStationstoNormalsSimultaneous ( const UINT32 & block)
private

Definition at line 2187 of file dnaadjust.cpp.

2188{
2189 it_vUINT32 _it_const;
2190
2191 UINT32 stn;
2192 matrix_2d var_cart(3, 3);
2193
2194 for (_it_const=v_parameterStationList_.at(block).begin();
2195 _it_const!=v_parameterStationList_.at(block).end();
2196 ++_it_const)
2197 {
2198
2199 // compute _var_cart for this station
2200 FormConstraintStationVarianceMatrix(_it_const, var_cart);
2201
2202 if (projectSettings_.g.verbose > 6)
2203 debug_file << "parameter station " << bstBinaryRecords_.at((*_it_const)).stationName << std::scientific << std::setprecision(16) << var_cart << std::endl;
2204
2205 // Add the variance to the normals
2206 stn = v_blockStationsMap_.at(block)[(*_it_const)] * 3;
2207 v_normals_.at(block).blockadd(stn, stn, var_cart, 0, 0, 3, 3);
2208 }
2209}

References bstBinaryRecords_, debug_file, FormConstraintStationVarianceMatrix(), projectSettings_, v_blockStationsMap_, v_normals_, and v_parameterStationList_.

Referenced by PrepareAdjustmentBlock(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FormConstraintStationVarianceMatrix()

void dynadjust::networkadjust::dna_adjust::FormConstraintStationVarianceMatrix ( const it_vUINT32 & _it_param_stn,
matrix_2d & var_cart )
private

Definition at line 2213 of file dnaadjust.cpp.

2215{
2216 vstn_t::const_iterator _it_stn(bstBinaryRecords_.begin() + (*_it_param_stn));
2217
2218 // Constrain this station so that it will not move?
2219 if (_it_stn->stationConst[0] == 'C' &&
2220 _it_stn->stationConst[1] == 'C' &&
2221 _it_stn->stationConst[2] == 'C')
2222 {
2223 // set to inverse of 'constrained' variance matrix
2224 var_cart = _inv_var_cart_c;
2225 return;
2226 }
2227
2228 // free; no constraint.
2229 if (_it_stn->stationConst[0] == 'F' &&
2230 _it_stn->stationConst[1] == 'F' &&
2231 _it_stn->stationConst[2] == 'F')
2232 {
2233 // set to inverse of 'free' variance matrix
2234 var_cart = _inv_var_cart_f;
2235 return;
2236 }
2237
2238 // If this point is reached, the station constraints will be a
2239 // combination of F and C. In this case, form a variance matrix
2240 // in the local reference frame and propagate to the cartesian
2241
2242 // CCF = constrained horizontally
2243 // FFC = constrained vertically
2244
2245 // For CF* and FC* (irrespective of height), read on...
2246 //
2247 // If FCC is supplied for geographic coordinates, then:
2248 // - latitude (north-south) is Free
2249 // - longitude (east-west) is Constrained
2250 //
2251 // If FCC is supplied for projection coordinates, then:
2252 // - easting (east-west) is Free
2253 // - northing (north-south) is Constrained
2254
2255 matrix_2d var_local(3, 3);
2256
2257 // first element
2258 if (_it_stn->stationConst[0] == 'F')
2259 {
2260 if (_it_stn->suppliedStationType == LLH_type_i)
2261 var_local.put(1, 1, _var_F); // Latitude: 'F'ree in the north-south (n/y) direction
2262 else
2263 var_local.put(0, 0, _var_F); // Easting/X: 'F'ree in the east-west or X direction
2264 }
2265 else
2266 {
2267 if (_it_stn->suppliedStationType == LLH_type_i)
2268 var_local.put(1, 1, _var_C); // Latitude: 'C'onstrained in the north-south (n/y) direction
2269 else
2270 var_local.put(0, 0, _var_C); // Easting/X: 'C'onstrained in the east-west or X direction
2271 }
2272
2273 // second element
2274 if (_it_stn->stationConst[1] == 'F')
2275 {
2276 if (_it_stn->suppliedStationType == LLH_type_i)
2277 var_local.put(0, 0, _var_F);
2278 else
2279 var_local.put(1, 1, _var_F);
2280 }
2281 else
2282 {
2283 if (_it_stn->suppliedStationType == LLH_type_i)
2284 var_local.put(0, 0, _var_C);
2285 else
2286 var_local.put(1, 1, _var_C);
2287 }
2288
2289 // ellipsoidal height - corresponds to up, whether coordinates are geographic, projection or cartesian
2290 if (_it_stn->stationConst[2] == 'F')
2291 var_local.put(2, 2, _var_F);
2292 else
2293 var_local.put(2, 2, _var_C);
2294
2295 // If station is in cartesian, assume constraints are in cartesian reference frame
2296 if (_it_stn->suppliedStationType == XYZ_type_i)
2297 var_cart = var_local;
2298 else
2299 // Propagate variance in local reference frame to cartesian reference frame
2300 PropagateVariances_LocalCart<double>(var_local, var_cart,
2301 _it_stn->currentLatitude, _it_stn->currentLongitude,
2302 true); // local to cart
2303
2304 FormInverseVarianceMatrix(&var_cart);
2305}
void PropagateVariances_LocalCart(const matrix_2d &mvariances, matrix_2d &mvariances_mod, const T &latitude, const T &longitude, bool LOCAL_TO_CART, matrix_2d &mrotations, bool CALCULATE_ROTATIONS=false)
@ XYZ_type_i
Definition dnatypes.hpp:360

References _inv_var_cart_c, _inv_var_cart_f, _var_C, _var_F, bstBinaryRecords_, FormInverseVarianceMatrix(), LLH_type_i, PropagateVariances_LocalCart(), dynadjust::math::matrix_2d::put(), and XYZ_type_i.

Referenced by AddConstraintStationstoNormalsCombine(), AddConstraintStationstoNormalsForward(), AddConstraintStationstoNormalsReverse(), and AddConstraintStationstoNormalsSimultaneous().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateNormalsR()

void dynadjust::networkadjust::dna_adjust::UpdateNormalsR ( const UINT32 & block)
private

◆ UpdateNormalsC()

void dynadjust::networkadjust::dna_adjust::UpdateNormalsC ( const UINT32 & block)
private

◆ CarryStnEstimatesandVariancesReverseR()

void dynadjust::networkadjust::dna_adjust::CarryStnEstimatesandVariancesReverseR ( const UINT32 & nextBlock,
const UINT32 & thisBlock )
private

◆ fillSinexExample()

static void dynadjust::networkadjust::dna_adjust::fillSinexExample ( )
staticprivate

References ComputeAdjMsrBlockOnIteration(), ComputeAdjustedMsrPrecisions(), ComputeandPrintAdjMsrBlockOnIteration(), ComputeandPrintAdjMsrOnIteration(), ComputeBlockTestStat(), ComputeChiSquare(), ComputeChiSquare_ABCEHIJKLMPQRSVZ(), ComputeChiSquare_D(), ComputeChiSquare_G(), ComputeChiSquare_XY(), ComputeChiSquareNetwork(), ComputeChiSquarePhased(), ComputeChiSquareSimultaneous(), ComputeGlobalNetStat(), ComputeGlobalPelzer(), ComputeGlobalPelzer_D(), ComputeGlobalPelzer_GXY(), ComputeGlobalTestStat(), ComputePrecisionAdjMsrs(), ComputePrecisionAdjMsrs_A(), ComputePrecisionAdjMsrs_BCEKLMSVZ(), ComputePrecisionAdjMsrs_D(), ComputePrecisionAdjMsrs_GX(), ComputePrecisionAdjMsrs_HIJPQR(), ComputePrecisionAdjMsrs_Y(), ComputeStatistics(), ComputeStatisticsOnIteration(), ComputeTestStat(), ComputeTstatistics(), FormInverseGPSVarianceMatrix(), FormInverseVarianceMatrix(), FormInverseVarianceMatrixReduced(), FormUniqueMsrList(), OpenOutputFileStreams(), PrintAdjGNSSAlternateUnits(), PrintAdjMeasurements(), PrintAdjMeasurements_A(), PrintAdjMeasurements_BKVZ(), PrintAdjMeasurements_CELMS(), PrintAdjMeasurements_D(), PrintAdjMeasurements_GXY(), PrintAdjMeasurements_HR(), PrintAdjMeasurements_IJPQ(), PrintAdjMeasurements_YLLH(), PrintAdjMeasurementsAngular(), PrintAdjMeasurementsHeader(), PrintAdjMeasurementsLinear(), PrintAdjMeasurementStatistics(), PrintAdjStation(), PrintAdjStations(), PrintAdjStationsUniqueList(), PrintCompMeasurements(), PrintCompMeasurements_A(), PrintCompMeasurements_BKVZ(), PrintCompMeasurements_CELMS(), PrintCompMeasurements_D(), PrintCompMeasurements_GXY(), PrintCompMeasurements_HR(), PrintCompMeasurements_IJPQ(), PrintCompMeasurements_YLLH(), PrintCompMeasurementsAngular(), PrintCompMeasurementsLinear(), PrintCorStation(), PrintCorStations(), PrintCorStationsUniqueList(), PrintIgnoredAdjMeasurements(), PrintMeasurementCorrection(), PrintMeasurementDatabaseID(), PrintMeasurementsAngular(), PrintMeasurementsLinear(), PrintPosUncertainties(), PrintPosUncertaintiesHeader(), PrintPosUncertaintiesUniqueList(), PrintPosUncertainty(), PrintStatistics(), ReduceYLLHMeasurementsforPrinting(), UpdateGeographicCoords(), UpdateGeographicCoordsPhased(), UpdateMsrRecord(), UpdateMsrRecords(), UpdateMsrRecords_D(), UpdateMsrRecords_GXY(), UpdateMsrRecordStats(), UpdateMsrTstatistic(), UpdateMsrTstatistic_D(), and UpdateMsrTstatistic_GXY().

Here is the call graph for this function:

◆ ComputeStatistics()

void dynadjust::networkadjust::dna_adjust::ComputeStatistics ( )
private

Definition at line 8096 of file dnaadjust.cpp.

8097{
8098 // initialise potential outlier count
8100
8101 // Compute adjusted measurement precisions. If this is a staged adjustment,
8102 // update normals and measured-computed matrices.
8104
8105 // Compute whole-of-network statistics.
8107
8108 // Compute DOF and sigma zero
8110
8111 // Update Student's T statistic
8112 if (projectSettings_.o._adj_msr_tstat)
8114
8115 // Compute Pelzer's reliability for whole-of-network
8117
8118 switch (projectSettings_.a.adjust_mode)
8119 {
8120 case Phased_Block_1Mode:
8121 return;
8122 }
8123
8124 // Perform global test
8126
8127}

References ComputeAdjustedMsrPrecisions(), ComputeChiSquareNetwork(), ComputeGlobalNetStat(), ComputeGlobalPelzer(), ComputeGlobalTestStat(), ComputeTstatistics(), Phased_Block_1Mode, potentialOutlierCount_, and projectSettings_.

Referenced by fillSinexExample(), and GenerateStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeStatisticsOnIteration()

void dynadjust::networkadjust::dna_adjust::ComputeStatisticsOnIteration ( )
private

Definition at line 8215 of file dnaadjust.cpp.

8216{
8217 // Compute whole-of-network statistics.
8219
8220 // Compute DOF and sigma zero
8222
8223 // Perform global test
8225}

References ComputeChiSquareNetwork(), ComputeGlobalNetStat(), and ComputeGlobalTestStat().

Referenced by AdjustPhased(), AdjustSimultaneous(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeTstatistics()

void dynadjust::networkadjust::dna_adjust::ComputeTstatistics ( )
private

Definition at line 8074 of file dnaadjust.cpp.

8075{
8076 // Now that rigorous sigma zero has been computed, compute Student's T statistic
8077 UINT32 block;
8078 switch (projectSettings_.a.adjust_mode)
8079 {
8080 case PhasedMode:
8081 for (block=0; block<blockCount_; ++block)
8082 {
8083 // Update measurement t statistic
8084 UpdateMsrTstatistic(block);
8085
8086 }
8087 break;
8088 case SimultaneousMode:
8089 case Phased_Block_1Mode: // only block 1 is rigorous
8090 // Update measurement t statistic
8092 break;
8093 }
8094}
void UpdateMsrTstatistic(const UINT32 &block=0)

References blockCount_, Phased_Block_1Mode, PhasedMode, projectSettings_, SimultaneousMode, and UpdateMsrTstatistic().

Referenced by ComputeStatistics(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrTstatistic()

void dynadjust::networkadjust::dna_adjust::UpdateMsrTstatistic ( const UINT32 & block = 0)
private

Definition at line 8038 of file dnaadjust.cpp.

8039{
8040 it_vUINT32 _it_block_msr;
8041 it_vmsr_t _it_msr;
8042
8043 for (_it_block_msr=v_CML_.at(block).begin();
8044 _it_block_msr!=v_CML_.at(block).end();
8045 ++_it_block_msr)
8046 {
8047 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
8048 continue;
8049
8050 switch (_it_msr->measType)
8051 {
8052 case 'D': // Direction set
8053 // When a target direction is found,
8054 // continue to next element.
8055 if (_it_msr->vectorCount1 < 1)
8056 continue;
8057 UpdateMsrTstatistic_D(_it_msr);
8058 continue;
8059 case 'G': // GPS Baseline (treat as single-baseline cluster)
8060 case 'X': // GPS Baseline cluster
8061 case 'Y': // GPS Point cluster
8062 UpdateMsrTstatistic_GXY(_it_msr);
8063 continue;
8064 }
8065
8066 if (fabs(sigmaZeroSqRt_ - 0.0) < PRECISION_1E10)
8067 _it_msr->TStat = 0.0;
8068 else
8069 _it_msr->TStat = _it_msr->NStat / sigmaZeroSqRt_;
8070
8071 }
8072}
void UpdateMsrTstatistic_GXY(it_vmsr_t &_it_msr)
void UpdateMsrTstatistic_D(it_vmsr_t &_it_msr)
const double PRECISION_1E10(1.0e-10)

References InitialiseandValidateMsrPointer(), PRECISION_1E10(), sigmaZeroSqRt_, UpdateMsrTstatistic_D(), UpdateMsrTstatistic_GXY(), and v_CML_.

Referenced by ComputeTstatistics(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrTstatistic_D()

void dynadjust::networkadjust::dna_adjust::UpdateMsrTstatistic_D ( it_vmsr_t & _it_msr)
private

Definition at line 7968 of file dnaadjust.cpp.

7969{
7970 UINT32 a, angle_count(_it_msr->vectorCount2 - 1);
7971 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
7972
7973 // move to first direction record which contains the derived angles
7974 _it_msr++;
7975
7976 for (a=0; a<angle_count; ++a) // for each angle
7977 {
7978 // cater for ignored directions
7979 if (_it_msr->ignore)
7980 {
7981 while (skip < ignored)
7982 {
7983 skip++;
7984 _it_msr++;
7985 if (!_it_msr->ignore)
7986 break;
7987 }
7988 }
7989
7990 if (fabs(sigmaZeroSqRt_ - 0.0) < PRECISION_1E10)
7991 _it_msr->TStat = 0.0;
7992 else
7993 _it_msr->TStat = _it_msr->NStat / sigmaZeroSqRt_;
7994 _it_msr++;
7995 }
7996
7997}

References PRECISION_1E10(), and sigmaZeroSqRt_.

Referenced by fillSinexExample(), and UpdateMsrTstatistic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrTstatistic_GXY()

void dynadjust::networkadjust::dna_adjust::UpdateMsrTstatistic_GXY ( it_vmsr_t & _it_msr)
private

Definition at line 7999 of file dnaadjust.cpp.

8000{
8001 UINT32 cluster_msr, cluster_count(_it_msr->vectorCount1);
8002 UINT32 covariance_count;
8003
8004 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
8005 {
8006 covariance_count = _it_msr->vectorCount2;
8007
8008 // X measurement
8009 if (fabs(sigmaZeroSqRt_ - 0.0) < PRECISION_1E10)
8010 _it_msr->TStat = 0.0;
8011 else
8012 _it_msr->TStat = _it_msr->NStat / sigmaZeroSqRt_;
8013 _it_msr++;
8014
8015 // Y measurement
8016 if (fabs(sigmaZeroSqRt_ - 0.0) < PRECISION_1E10)
8017 _it_msr->TStat = 0.0;
8018 else
8019 _it_msr->TStat = _it_msr->NStat / sigmaZeroSqRt_;
8020 _it_msr++;
8021
8022
8023 // Z measurement
8024 if (fabs(sigmaZeroSqRt_ - 0.0) < PRECISION_1E10)
8025 _it_msr->TStat = 0.0;
8026 else
8027 _it_msr->TStat = _it_msr->NStat / sigmaZeroSqRt_;
8028
8029 // skip covariances until next point
8030 _it_msr += covariance_count * 3;
8031
8032 if (covariance_count > 0)
8033 _it_msr++;
8034 }
8035}

References PRECISION_1E10(), and sigmaZeroSqRt_.

Referenced by fillSinexExample(), and UpdateMsrTstatistic().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeandPrintAdjMsrOnIteration()

void dynadjust::networkadjust::dna_adjust::ComputeandPrintAdjMsrOnIteration ( )
private

Definition at line 8130 of file dnaadjust.cpp.

8131{
8132 // initialise potential outlier count
8134 bool printHeader(true);
8135
8136 _it_uint32_u32u32_pair begin, end;
8137 begin = v_msr_block_.begin();
8138
8139 // Compute and print adjusted measurements for all
8140 // blocks at the end of an iteration
8141 for (UINT32 block(0); block<blockCount_; ++block)
8142 {
8143 if (projectSettings_.a.stage)
8146
8147 // send subvector of measurements from this block
8148 end = begin + v_CML_.at(block).size();
8149 ComputeandPrintAdjMsrBlockOnIteration(block, v_uint32_u32u32_pair(begin, end), printHeader);
8150 begin = end;
8151 printHeader = false;
8152
8153 if (projectSettings_.a.stage)
8154 UnloadBlock(block, 4, sf_normals,
8156 }
8157}

References blockCount_, ComputeandPrintAdjMsrBlockOnIteration(), DeserialiseBlockFromMappedFile(), potentialOutlierCount_, projectSettings_, sf_design, sf_meas_minus_comp, sf_normals, sf_prec_adj_msrs, UnloadBlock(), v_CML_, and v_msr_block_.

Referenced by AdjustPhased(), AdjustSimultaneous(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeandPrintAdjMsrBlockOnIteration()

void dynadjust::networkadjust::dna_adjust::ComputeandPrintAdjMsrBlockOnIteration ( const UINT32 & block,
v_uint32_u32u32_pair msr_block,
bool printHeader )
private

Definition at line 8204 of file dnaadjust.cpp.

8205{
8206 // Compute adjusted measurements
8208
8209 // Print adjusted measurements
8210 PrintAdjMeasurements(msr_block, printHeader);
8211
8212}

References ComputeAdjMsrBlockOnIteration(), and PrintAdjMeasurements().

Referenced by AdjustPhasedForward(), ComputeandPrintAdjMsrOnIteration(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeAdjMsrBlockOnIteration()

void dynadjust::networkadjust::dna_adjust::ComputeAdjMsrBlockOnIteration ( const UINT32 & block)
private

Definition at line 8159 of file dnaadjust.cpp.

8160{
8161 // Compute adjusted measurement precisions (v_precAdjMsrsFull_)
8162 // from design and rigorous station variances
8164
8165 // Update measurement records and Pelzer's Global reliability
8166 UpdateMsrRecords(block);
8167
8168 if (projectSettings_.a.stage)
8169 ComputeChiSquarePhased(block); // This initialises chiSquared_ on each call
8170
8171 if (projectSettings_.o._adj_msr_iteration ||
8172 projectSettings_.o._adj_stn_iteration ||
8173 projectSettings_.o._cmp_msr_iteration)
8174 {
8175 ComputeChiSquarePhased(block); // This initialises chiSquared_ on each call
8176
8177 switch (projectSettings_.a.adjust_mode)
8178 {
8179 case PhasedMode:
8180 case Phased_Block_1Mode:
8181
8182 ComputeBlockTestStat(block);
8183
8185 v_passFail_.at(block) != test_stat_pass ||
8186 // a much larger than expected outcome
8187 v_sigmaZero_.at(block) > 3.0 * v_chiSquaredUpperLimit_.at(block));
8188 break;
8189 default:
8192
8194 // a much larger than expected outcome
8196 break;
8197 }
8198
8199
8200 }
8201}
void ComputeChiSquarePhased(const UINT32 &block)
void ComputePrecisionAdjMsrs(const UINT32 &block=0)
void UpdateMsrRecords(const UINT32 &block=0)
void ComputeBlockTestStat(const UINT32 &block)

References chiSquaredUpperLimit_, ComputeBlockTestStat(), ComputeChiSquarePhased(), ComputeGlobalNetStat(), ComputeGlobalTestStat(), ComputePrecisionAdjMsrs(), isAdjustmentQuestionable_, Phased_Block_1Mode, PhasedMode, projectSettings_, sigmaZero_, test_stat_pass, UpdateMsrRecords(), v_chiSquaredUpperLimit_, v_passFail_, and v_sigmaZero_.

Referenced by AdjustPhasedReverseCombine(), ComputeandPrintAdjMsrBlockOnIteration(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeAdjustedMsrPrecisions()

void dynadjust::networkadjust::dna_adjust::ComputeAdjustedMsrPrecisions ( )
private

Definition at line 7923 of file dnaadjust.cpp.

7924{
7925 // Compute adjusted measurement precisions
7926 UINT32 block;
7927 switch (projectSettings_.a.adjust_mode)
7928 {
7929 case PhasedMode:
7930 for (block=0; block<blockCount_; ++block)
7931 {
7932 // For staged adjustments, load block info
7933 if (projectSettings_.a.stage)
7934 {
7939 v_normals_.at(block) = v_rigorousVariances_.at(block);
7940
7941 FillDesignNormalMeasurementsMatrices(false, block, false);
7942 }
7943
7944 // Compute adjusted measurement precisions (v_precAdjMsrsFull_)
7945 // from design and rigorous station variances
7947
7948 // Update measurement records and Pelzer's Global reliability
7949 UpdateMsrRecords(block);
7950
7951 // For staged adjustments, unload all matrix data
7952 if (projectSettings_.a.stage)
7953 UnloadBlock(block);
7954 }
7955 break;
7956 case SimultaneousMode:
7957 case Phased_Block_1Mode: // only block 1 is rigorous
7958 // Compute adjusted measurement precisions (v_precAdjMsrsFull_)
7959 // from design and rigorous station variances
7961
7962 // Update measurement records and Pelzer's Global reliability
7964 break;
7965 }
7966}

References blockCount_, ComputePrecisionAdjMsrs(), DeserialiseBlockFromMappedFile(), FillDesignNormalMeasurementsMatrices(), Phased_Block_1Mode, PhasedMode, projectSettings_, sf_atvinv, sf_design, sf_estimated_stns, sf_meas_minus_comp, sf_normals, sf_prec_adj_msrs, sf_rigorous_vars, SimultaneousMode, UnloadBlock(), UpdateMsrRecords(), v_normals_, and v_rigorousVariances_.

Referenced by ComputeStatistics(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquareNetwork()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquareNetwork ( )
private

Definition at line 8286 of file dnaadjust.cpp.

8287{
8288 UINT32 block;
8289 double chiSquared(0.);
8290
8291 // Compute measurement statistics
8292 switch (projectSettings_.a.adjust_mode)
8293 {
8294 case PhasedMode:
8296 for (block=0; block<blockCount_; ++block)
8297 {
8298 // For staged adjustments, load block info
8299 if (projectSettings_.a.stage)
8301
8302 ComputeChiSquarePhased(block); // This initialises chiSquared_ on each call,
8303 chiSquared += chiSquared_; // so increment a local and update chiSquared_ later
8305
8306 // For staged adjustments, unload all matrix data
8307 if (projectSettings_.a.stage)
8308 UnloadBlock(block);
8309 }
8310
8311 // update global
8312 chiSquared_ = chiSquared;
8313 break;
8314 case Phased_Block_1Mode: // only block 1 is rigorous
8315 case SimultaneousMode:
8317 break;
8318 }
8319}

References blockCount_, chiSquared_, ComputeChiSquarePhased(), ComputeChiSquareSimultaneous(), DeserialiseBlockFromMappedFile(), measurementParams_, Phased_Block_1Mode, PhasedMode, projectSettings_, sf_meas_minus_comp, SimultaneousMode, UnloadBlock(), and v_measurementParams_.

Referenced by ComputeStatistics(), ComputeStatisticsOnIteration(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquare()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquare ( const UINT32 & block)
private

Definition at line 8228 of file dnaadjust.cpp.

8229{
8230 UINT32 measurement_index(0);
8231
8232 it_vUINT32 _it_block_msr;
8233 it_vmsr_t _it_msr;
8234
8235 // Initialise chi-square
8236 chiSquared_ = 0.;
8237
8238 for (_it_block_msr=v_CML_.at(block).begin();
8239 _it_block_msr!=v_CML_.at(block).end();
8240 ++_it_block_msr)
8241 {
8242 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
8243 continue;
8244
8245 switch (_it_msr->measType)
8246 {
8247 case 'A': // Horizontal angle
8248 case 'B': // Geodetic azimuth
8249 case 'C': // Chord dist
8250 case 'E': // Ellipsoid arc
8251 case 'H': // Orthometric height
8252 case 'I': // Astronomic latitude
8253 case 'J': // Astronomic longitude
8254 case 'K': // Astronomic azimuth
8255 case 'L': // Level difference
8256 case 'M': // MSL arc
8257 case 'P': // Geodetic latitude
8258 case 'Q': // Geodetic longitude
8259 case 'R': // Ellipsoidal height
8260 case 'S': // Slope distance
8261 case 'V': // Zenith distance
8262 case 'Z': // Vertical angle
8263 ComputeChiSquare_ABCEHIJKLMPQRSVZ(_it_msr, measurement_index, &v_measMinusComp_.at(block));
8264 break;
8265
8266 case 'D':
8267 // When a target direction is found, continue to next element.
8268 if (_it_msr->vectorCount1 < 1)
8269 continue;
8270 ComputeChiSquare_D(_it_msr, measurement_index, &v_measMinusComp_.at(block));
8271 break;
8272
8273 case 'G': // GPS Baseline
8274 ComputeChiSquare_G(_it_msr, measurement_index, &v_measMinusComp_.at(block));
8275 break;
8276
8277 case 'X':
8278 case 'Y':
8279 ComputeChiSquare_XY(_it_msr, measurement_index, &v_measMinusComp_.at(block));
8280 break;
8281 }
8282 }
8283}
void ComputeChiSquare_XY(const it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)
void ComputeChiSquare_G(const it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)
void ComputeChiSquare_ABCEHIJKLMPQRSVZ(const it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)
void ComputeChiSquare_D(it_vmsr_t &_it_msr, UINT32 &measurement_index, matrix_2d *measMinusComp)

References chiSquared_, ComputeChiSquare_ABCEHIJKLMPQRSVZ(), ComputeChiSquare_D(), ComputeChiSquare_G(), ComputeChiSquare_XY(), InitialiseandValidateMsrPointer(), v_CML_, and v_measMinusComp_.

Referenced by ComputeChiSquarePhased(), ComputeChiSquareSimultaneous(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquareSimultaneous()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquareSimultaneous ( )
private

Definition at line 7829 of file dnaadjust.cpp.

7830{
7833
7834 // Compute adjusted measurement statistics
7836}
void ComputeChiSquare(const UINT32 &block)

References ComputeChiSquare(), measurementCount_, measurementParams_, v_measurementCount_, and v_measurementParams_.

Referenced by ComputeChiSquareNetwork(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquarePhased()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquarePhased ( const UINT32 & block)
private

Definition at line 8322 of file dnaadjust.cpp.

8323{
8324 // Compute adjusted measurement statistics
8325 ComputeChiSquare(block);
8326}

References ComputeChiSquare().

Referenced by ComputeAdjMsrBlockOnIteration(), ComputeChiSquareNetwork(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeTestStat()

void dynadjust::networkadjust::dna_adjust::ComputeTestStat ( const double & dof,
double & chiUpper,
double & chiLower,
double & sigmaZero,
UINT32 & passFail )
private

Definition at line 7851 of file dnaadjust.cpp.

7852{
7853 // Calculate limits using boost libraries
7854 // Confidence is halved (i.e. * 0.5) because it is a two-sided (upper and lower limit) test.
7855 double confidence = (100. - projectSettings_.a.confidence_interval) * 0.01;
7856 double conf = confidence * 0.5;
7857
7858 try {
7859 // chi_squared throws when dof == 0
7860 boost::math::chi_squared dist(dof);
7861
7862 chiUpper = boost::math::quantile(boost::math::complement(dist, conf)) / degreesofFreedom_;
7863 chiLower = boost::math::quantile(dist, conf) / degreesofFreedom_;
7864
7865 switch (projectSettings_.a.adjust_mode)
7866 {
7867 case PhasedMode:
7868 case Phased_Block_1Mode:
7869 sigmaZero = chiSquared_ / dof;
7870 break;
7871 }
7872
7873 // A pass is when sigma-zero is less than the chi-square upper limit. Strictly speaking,
7874 // a value lower than the lower limit is not a fail.
7875 if (sigmaZero < chiLower)
7876 passFail = test_stat_warning;
7877 else if (sigmaZero > chiUpper)
7878 passFail = test_stat_fail;
7879 else
7880 passFail = test_stat_pass;
7881 }
7882 catch (const std::exception& e)
7883 {
7884 // This is not a critical error, so don't throw an exception. Rather,
7885 // just print message to output files
7886
7887 if (projectSettings_.g.verbose > 0)
7888 debug_file << std::endl << "ComputeTestStat():\n " << e.what() << std::endl;
7889
7890 if (projectSettings_.g.verbose > 0)
7891 if (dof == 0)
7892 adj_file << std::endl << "Cannot perform chi-square test with zero degrees of freedom." << std::endl << std::endl;
7893
7894 passFail = test_stat_fail;
7895 }
7896}
@ test_stat_fail
Definition dnatypes.hpp:315
@ test_stat_warning
Definition dnatypes.hpp:314

References adj_file, chiSquared_, debug_file, degreesofFreedom_, Phased_Block_1Mode, PhasedMode, projectSettings_, test_stat_fail, test_stat_pass, and test_stat_warning.

Referenced by ComputeBlockTestStat(), ComputeGlobalTestStat(), and fillSinexExample().

Here is the caller graph for this function:

◆ ComputeBlockTestStat()

void dynadjust::networkadjust::dna_adjust::ComputeBlockTestStat ( const UINT32 & block)
private

Definition at line 7906 of file dnaadjust.cpp.

7907{
7908 UINT32 passFail(test_stat_pass);
7909
7911 v_statSummary_.at(block)._degreesofFreedom,
7912 v_chiSquaredUpperLimit_.at(block),
7913 v_chiSquaredLowerLimit_.at(block),
7914 v_sigmaZero_.at(block),
7915 passFail);
7916
7917 // std::vector<bool> is a specialisation, and as such the value
7918 // returned from at() is not a bool, but a wrapper around a value
7919 v_passFail_.at(block) = passFail;
7920}
void ComputeTestStat(const double &dof, double &chiUpper, double &chiLower, double &sigmaZero, UINT32 &passFail)

References ComputeTestStat(), test_stat_pass, v_chiSquaredLowerLimit_, v_chiSquaredUpperLimit_, v_passFail_, v_sigmaZero_, and v_statSummary_.

Referenced by ComputeAdjMsrBlockOnIteration(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeGlobalTestStat()

void dynadjust::networkadjust::dna_adjust::ComputeGlobalTestStat ( )
private

Definition at line 7899 of file dnaadjust.cpp.

References chiSquaredLowerLimit_, chiSquaredUpperLimit_, ComputeTestStat(), degreesofFreedom_, passFail_, and sigmaZero_.

Referenced by ComputeAdjMsrBlockOnIteration(), ComputeStatistics(), ComputeStatisticsOnIteration(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeGlobalNetStat()

void dynadjust::networkadjust::dna_adjust::ComputeGlobalNetStat ( )
private

◆ ComputePrecisionAdjMsrs()

void dynadjust::networkadjust::dna_adjust::ComputePrecisionAdjMsrs ( const UINT32 & block = 0)
private

Definition at line 8483 of file dnaadjust.cpp.

8484{
8485 if (projectSettings_.a.report_mode)
8486 return;
8487
8488 // A*V-1*At, where:
8489 // - A is design matrix
8490 // - V is the inverse of the normals (i.e. precision of estimates)
8491 v_precAdjMsrsFull_.at(block).zero();
8492
8493 UINT32 design_row(0);
8494 UINT32 precadjmsr_row(0);
8495
8496 it_vUINT32 _it_block_msr;
8497 it_vmsr_t _it_msr;
8498
8499 matrix_2d *design(&v_design_.at(block)), *aposterioriVariances(&v_normals_.at(block));
8500
8501 // Measurements can only ever appear once in the whole CML. That is, no one measurement will be found
8502 // in two or more blocks. Therefore, unlike precisions of adjusted stations (which may appear in one
8503 // or more blocks), precisions of adjusted measurements are unique.
8504 for (_it_block_msr=v_CML_.at(block).begin(); _it_block_msr!=v_CML_.at(block).end(); ++_it_block_msr)
8505 {
8506 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
8507 continue;
8508
8509 // Build At * V-1 (diagonals only as full covariances are not required)
8510 switch (_it_msr->measType)
8511 {
8512 case 'A': // Horizontal angle
8514 GetBlkMatrixElemStn1(block, &_it_msr),
8515 GetBlkMatrixElemStn2(block, &_it_msr),
8516 GetBlkMatrixElemStn3(block, &_it_msr),
8517 design, aposterioriVariances,
8518 design_row, precadjmsr_row);
8519 break;
8520 case 'D': // Direction set
8521 // When a target direction is found, continue to next element.
8522 if (_it_msr->vectorCount1 < 1)
8523 continue;
8524 ComputePrecisionAdjMsrs_D(block, _it_msr,
8525 design, aposterioriVariances,
8526 design_row, precadjmsr_row);
8527 break;
8528 // Single station measurements
8529 case 'H': // Orthometric height
8530 case 'I': // Astronomic latitude
8531 case 'J': // Astronomic longitude
8532 case 'P': // Geodetic latitude
8533 case 'Q': // Geodetic longitude
8534 case 'R': // Ellipsoidal height
8536 GetBlkMatrixElemStn1(block, &_it_msr),
8537 design, aposterioriVariances,
8538 design_row, precadjmsr_row);
8539 break;
8540 // Two station measurements
8541 case 'B': // Geodetic azimuth
8542 case 'C': // Chord dist
8543 case 'E': // Ellipsoid arc
8544 case 'K': // Astronomic azimuth
8545 case 'L': // Level difference
8546 case 'M': // MSL arc
8547 case 'S': // Slope distance
8548 case 'V': // Zenith distance
8549 case 'Z': // Vertical angle
8551 GetBlkMatrixElemStn1(block, &_it_msr),
8552 GetBlkMatrixElemStn2(block, &_it_msr),
8553 design, aposterioriVariances,
8554 design_row, precadjmsr_row);
8555 break;
8556 case 'G': // GPS Baseline
8557 case 'X': // GPS Baseline cluster
8558 ComputePrecisionAdjMsrs_GX(block, _it_msr,
8559 aposterioriVariances, design_row, precadjmsr_row);
8560 break;
8561 case 'Y': // GPS Point cluster
8562 ComputePrecisionAdjMsrs_Y(block, _it_msr,
8563 aposterioriVariances, design_row, precadjmsr_row);
8564 break;
8565 default:
8566 std::stringstream ss;
8567 ss << "ComputePrecisionAdjMsrs(): Unknown measurement type - '" << static_cast<std::string>(&(_it_msr->measType)) <<
8568 "'." << std::endl;
8569 SignalExceptionAdjustment(ss.str(), block);
8570 }
8571 }
8572}
void ComputePrecisionAdjMsrs_GX(const UINT32 &block, it_vmsr_t &_it_msr, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
void ComputePrecisionAdjMsrs_A(const UINT32 &block, const UINT32 &stn1, const UINT32 &stn2, const UINT32 &stn3, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
void ComputePrecisionAdjMsrs_HIJPQR(const UINT32 &block, const UINT32 &stn1, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
void ComputePrecisionAdjMsrs_D(const UINT32 &block, it_vmsr_t &_it_msr, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
void ComputePrecisionAdjMsrs_BCEKLMSVZ(const UINT32 &block, const UINT32 &stn1, const UINT32 &stn2, matrix_2d *design, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)
void ComputePrecisionAdjMsrs_Y(const UINT32 &block, it_vmsr_t &_it_msr, matrix_2d *aposterioriVariances, UINT32 &design_row, UINT32 &precadjmsr_row)

References ComputePrecisionAdjMsrs_A(), ComputePrecisionAdjMsrs_BCEKLMSVZ(), ComputePrecisionAdjMsrs_D(), ComputePrecisionAdjMsrs_GX(), ComputePrecisionAdjMsrs_HIJPQR(), ComputePrecisionAdjMsrs_Y(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), GetBlkMatrixElemStn3(), InitialiseandValidateMsrPointer(), projectSettings_, SignalExceptionAdjustment(), v_CML_, v_design_, v_normals_, and v_precAdjMsrsFull_.

Referenced by ComputeAdjMsrBlockOnIteration(), ComputeAdjustedMsrPrecisions(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputePrecisionAdjMsrs_A()

void dynadjust::networkadjust::dna_adjust::ComputePrecisionAdjMsrs_A ( const UINT32 & block,
const UINT32 & stn1,
const UINT32 & stn2,
const UINT32 & stn3,
matrix_2d * design,
matrix_2d * aposterioriVariances,
UINT32 & design_row,
UINT32 & precadjmsr_row )
private

Definition at line 8575 of file dnaadjust.cpp.

8578{
8579 // Horizontal angle
8580 double part_1[9] = {0.,0.,0.,0.,0.,0.,0.,0.,0.};
8581 UINT32 stations[3] = {stn1, stn2, stn3};
8582 UINT32 station_count(3);
8583 UINT32 station_i[3] = {0, 3, 6};
8584 UINT32 var, elem(0);
8585 UINT32 j, i, s;
8586
8587 for (s=0; s<station_count; ++s) // for every station
8588 {
8589 for (i=0; i<3; ++i) // X, Y, Z
8590 {
8591 for (j=0; j<station_count; ++j) // for every correlated station
8592 {
8593 var = stations[j];
8594 part_1[elem] += design->get(design_row, var) * aposterioriVariances->get(var, stations[s]+i);
8595 part_1[elem] += design->get(design_row, var+1) * aposterioriVariances->get(var+1, stations[s]+i);
8596 part_1[elem] += design->get(design_row, var+2) * aposterioriVariances->get(var+2, stations[s]+i);
8597 }
8598 elem++;
8599 }
8600 }
8601
8602 for (s=0; s<station_count; ++s) // for every station
8603 for (i=0; i<3; ++i) // X, Y, Z
8604 v_precAdjMsrsFull_.at(block).elementadd(precadjmsr_row, 0, part_1[station_i[s]+i] * design->get(design_row, stations[s]+i));
8605
8606 design_row++;
8607 precadjmsr_row++;
8608}

References dynadjust::math::matrix_2d::get(), and v_precAdjMsrsFull_.

Referenced by ComputePrecisionAdjMsrs(), ComputePrecisionAdjMsrs_D(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputePrecisionAdjMsrs_D()

void dynadjust::networkadjust::dna_adjust::ComputePrecisionAdjMsrs_D ( const UINT32 & block,
it_vmsr_t & _it_msr,
matrix_2d * design,
matrix_2d * aposterioriVariances,
UINT32 & design_row,
UINT32 & precadjmsr_row )
private

Definition at line 8611 of file dnaadjust.cpp.

8614{
8615 UINT32 stn1, stn2, stn3;
8616 UINT32 a, angle_count(_it_msr->vectorCount2 - 1); // number of directions excluding the RO
8617 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
8618
8619 for (a=0; a<angle_count; ++a)
8620 {
8621 // On the first time this loop is entered, the stn1 and stn2 will be instrument and RO
8622 // Then, all following directions will be instrument and target.
8623 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
8624 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
8625 _it_msr++;
8626
8627 // cater for ignored directions
8628 if (_it_msr->ignore)
8629 {
8630 while (skip < ignored)
8631 {
8632 skip++;
8633 _it_msr++;
8634 if (!_it_msr->ignore)
8635 break;
8636 }
8637 }
8638
8639 stn3 = GetBlkMatrixElemStn2(block, &_it_msr);
8640
8641 ComputePrecisionAdjMsrs_A(block, stn1, stn2, stn3,
8642 design, aposterioriVariances, design_row, precadjmsr_row);
8643 }
8644}

References ComputePrecisionAdjMsrs_A(), GetBlkMatrixElemStn1(), and GetBlkMatrixElemStn2().

Referenced by ComputePrecisionAdjMsrs(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputePrecisionAdjMsrs_BCEKLMSVZ()

void dynadjust::networkadjust::dna_adjust::ComputePrecisionAdjMsrs_BCEKLMSVZ ( const UINT32 & block,
const UINT32 & stn1,
const UINT32 & stn2,
matrix_2d * design,
matrix_2d * aposterioriVariances,
UINT32 & design_row,
UINT32 & precadjmsr_row )
private

Definition at line 8647 of file dnaadjust.cpp.

8650{
8651 // Two station measurement
8652 double part_1[6] = {0.,0.,0.,0.,0.,0.};
8653 UINT32 stations[2] = {stn1, stn2};
8654 UINT32 station_count(2);
8655 UINT32 station_i[2] = {0, 3};
8656 UINT32 var, elem(0);
8657 UINT32 j, i, s;
8658
8659 for (s=0; s<station_count; ++s) // for every station
8660 {
8661 for (i=0; i<3; ++i) // X, Y, Z
8662 {
8663 for (j=0; j<station_count; ++j) // for every correlated station
8664 {
8665 var = stations[j];
8666 part_1[elem] += design->get(design_row, var) * aposterioriVariances->get(var, stations[s]+i);
8667 part_1[elem] += design->get(design_row, var+1) * aposterioriVariances->get(var+1, stations[s]+i);
8668 part_1[elem] += design->get(design_row, var+2) * aposterioriVariances->get(var+2, stations[s]+i);
8669 }
8670 elem++;
8671 }
8672 }
8673
8674 for (s=0; s<station_count; ++s) // for every station
8675 for (i=0; i<3; ++i) // X, Y, Z
8676 v_precAdjMsrsFull_.at(block).elementadd(precadjmsr_row, 0, part_1[station_i[s]+i] * design->get(design_row, stations[s]+i));
8677
8678 design_row++;
8679 precadjmsr_row++;
8680}

References dynadjust::math::matrix_2d::get(), and v_precAdjMsrsFull_.

Referenced by ComputePrecisionAdjMsrs(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputePrecisionAdjMsrs_HIJPQR()

void dynadjust::networkadjust::dna_adjust::ComputePrecisionAdjMsrs_HIJPQR ( const UINT32 & block,
const UINT32 & stn1,
matrix_2d * design,
matrix_2d * aposterioriVariances,
UINT32 & design_row,
UINT32 & precadjmsr_row )
private

Definition at line 8683 of file dnaadjust.cpp.

8686{
8687 // Single station measurement
8688 double part_1[3] = {0.,0.,0.};
8689 UINT32 i, elem;
8690
8691 for (elem=0,i=0; i<3; ++i) // X, Y, Z
8692 {
8693 part_1[elem] += design->get(design_row, stn1) * aposterioriVariances->get(stn1, stn1+i);
8694 part_1[elem] += design->get(design_row, stn1+1) * aposterioriVariances->get(stn1+1, stn1+i);
8695 part_1[elem] += design->get(design_row, stn1+2) * aposterioriVariances->get(stn1+2, stn1+i);
8696 elem++;
8697 }
8698
8699 for (i=0; i<3; ++i) // X, Y, Z
8700 v_precAdjMsrsFull_.at(block).elementadd(precadjmsr_row, 0, part_1[i] * design->get(design_row, stn1+i));
8701
8702 design_row++;
8703 precadjmsr_row++;
8704}

References dynadjust::math::matrix_2d::get(), and v_precAdjMsrsFull_.

Referenced by ComputePrecisionAdjMsrs(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputePrecisionAdjMsrs_GX()

void dynadjust::networkadjust::dna_adjust::ComputePrecisionAdjMsrs_GX ( const UINT32 & block,
it_vmsr_t & _it_msr,
matrix_2d * aposterioriVariances,
UINT32 & design_row,
UINT32 & precadjmsr_row )
private

Definition at line 8707 of file dnaadjust.cpp.

8710{
8711 UINT32 cluster_bsl, baseline_count(_it_msr->vectorCount1);
8712 UINT32 stn1, stn2;
8713 UINT32 i, j;
8714
8715 matrix_2d precision_bsl(3, 3);
8716
8717 for (cluster_bsl=0; cluster_bsl<baseline_count; ++cluster_bsl)
8718 {
8719 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
8720 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
8721
8722 Precision_Adjusted_GNSS_bsl<double>(*aposterioriVariances,
8723 stn1, stn2, &precision_bsl, false);
8724
8725 for (i=0; i<3; ++i)
8726 for (j=i; j<3; ++j, ++precadjmsr_row)
8727 v_precAdjMsrsFull_.at(block).put(precadjmsr_row, 0, precision_bsl.get(i, j));
8728
8729 design_row += 3;
8730 _it_msr += 3;
8731 }
8732}
void Precision_Adjusted_GNSS_bsl(const matrix_2d &mvariances, const UINT32 &stn1, const UINT32 &stn2, matrix_2d *mvariances_mod, bool FILLLOWER=true)

References dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), Precision_Adjusted_GNSS_bsl(), and v_precAdjMsrsFull_.

Referenced by ComputePrecisionAdjMsrs(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputePrecisionAdjMsrs_Y()

void dynadjust::networkadjust::dna_adjust::ComputePrecisionAdjMsrs_Y ( const UINT32 & block,
it_vmsr_t & _it_msr,
matrix_2d * aposterioriVariances,
UINT32 & design_row,
UINT32 & precadjmsr_row )
private

Definition at line 8735 of file dnaadjust.cpp.

8738{
8739 UINT32 cluster_pnt, point_count(_it_msr->vectorCount1);
8740 UINT32 stn1, i, j;
8741
8742 for (cluster_pnt=0; cluster_pnt<point_count; ++cluster_pnt)
8743 {
8744 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
8745
8746 for (i=0; i<3; ++i)
8747 {
8748 for (j=i; j<3; ++j, ++precadjmsr_row)
8749 {
8750 v_precAdjMsrsFull_.at(block).put(precadjmsr_row, 0,
8751 aposterioriVariances->get(stn1+i, stn1+j));
8752 }
8753 }
8754
8755 design_row +=3;
8756 _it_msr += 3;
8757 }
8758}

References dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), and v_precAdjMsrsFull_.

Referenced by ComputePrecisionAdjMsrs(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrRecords()

void dynadjust::networkadjust::dna_adjust::UpdateMsrRecords ( const UINT32 & block = 0)
private

Definition at line 8781 of file dnaadjust.cpp.

8782{
8783 UINT32 msr_row(0), precadjmsr_row(0);
8784
8785 it_vUINT32 _it_block_msr;
8786 it_vmsr_t _it_msr;
8787
8788 for (_it_block_msr=v_CML_.at(block).begin();
8789 _it_block_msr!=v_CML_.at(block).end();
8790 ++_it_block_msr)
8791 {
8792 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
8793 continue;
8794
8795 switch (_it_msr->measType)
8796 {
8797 case 'D': // Direction set
8798 // When a target direction is found,
8799 // continue to next element.
8800 if (_it_msr->vectorCount1 < 1)
8801 continue;
8802 UpdateMsrRecords_D(block, _it_msr, msr_row, precadjmsr_row);
8803 continue;
8804 case 'G': // GPS Baseline (treat as single-baseline cluster)
8805 case 'X': // GPS Baseline cluster
8806 case 'Y': // GPS Point cluster
8807 UpdateMsrRecords_GXY(block, _it_msr, msr_row, precadjmsr_row);
8808 continue;
8809 }
8810
8811 // Update measurement record with adjusted measurement values
8812 UpdateMsrRecord(block, _it_msr, msr_row++, precadjmsr_row++, _it_msr->term2);
8813
8814 }
8815}
void UpdateMsrRecord(const UINT32 &block, it_vmsr_t &_it_msr, const UINT32 &msr_row, const UINT32 &precadjmsr_row, const double &measPrec)
void UpdateMsrRecords_GXY(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &msr_row, UINT32 &precadjmsr_row)
void UpdateMsrRecords_D(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &msr_row, UINT32 &precadjmsr_row)

References InitialiseandValidateMsrPointer(), UpdateMsrRecord(), UpdateMsrRecords_D(), UpdateMsrRecords_GXY(), and v_CML_.

Referenced by ComputeAdjMsrBlockOnIteration(), ComputeAdjustedMsrPrecisions(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrRecord()

void dynadjust::networkadjust::dna_adjust::UpdateMsrRecord ( const UINT32 & block,
it_vmsr_t & _it_msr,
const UINT32 & msr_row,
const UINT32 & precadjmsr_row,
const double & measPrec )
private

Definition at line 8885 of file dnaadjust.cpp.

8887{
8888 // set adjusted measurement correction
8889 _it_msr->measCorr = -v_measMinusComp_.at(block).get(msr_row, 0);
8890
8891 // apply adjusted measurement correction
8892 if (_it_msr->measType == 'D')
8893 {
8894 _it_msr->measAdj = _it_msr->scale1 + _it_msr->measCorr;
8895 if (_it_msr->measAdj > TWO_PI)
8896 _it_msr->measAdj -= TWO_PI;
8897 }
8898 else
8899 _it_msr->measAdj = _it_msr->term1 + _it_msr->measCorr;
8900
8901 UINT32 stn1, stn2;
8902 it_vstn_t_const stn1_it, stn2_it;
8903 matrix_2d* estimatedStations(&v_estimatedStations_.at(block));
8904
8905 // Recompute measurements using the original types
8906 switch (_it_msr->measType)
8907 {
8908 case 'E':
8909 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
8910 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
8911 stn1_it = bstBinaryRecords_.begin() + _it_msr->station1;
8912 stn2_it = bstBinaryRecords_.begin() + _it_msr->station2;
8913
8914 // reduce adjusted measurement to ellipsoid arc
8915 _it_msr->measAdj = EllipsoidChordtoEllipsoidArc<double>(
8916 _it_msr->measAdj,
8917 estimatedStations->get(stn1, 0),
8918 estimatedStations->get(stn1+1, 0),
8919 estimatedStations->get(stn1+2, 0),
8920 estimatedStations->get(stn2, 0),
8921 estimatedStations->get(stn2+1, 0),
8922 estimatedStations->get(stn2+2, 0),
8923 stn1_it->currentLatitude,
8924 stn1_it->currentLongitude,
8925 stn2_it->currentLatitude,
8926 datum_.GetEllipsoidRef());
8927 break;
8928
8929 case 'M':
8930 stn1 = GetBlkMatrixElemStn1(block, &_it_msr);
8931 stn2 = GetBlkMatrixElemStn2(block, &_it_msr);
8932 stn1_it = bstBinaryRecords_.begin() + _it_msr->station1;
8933 stn2_it = bstBinaryRecords_.begin() + _it_msr->station2;
8934
8935 // reduce adjusted measurement to MSL arc
8936 _it_msr->measAdj = EllipsoidChordtoMSLArc<double>(
8937 _it_msr->measAdj,
8938 stn1_it->currentLatitude,
8939 stn2_it->currentLatitude,
8940 stn1_it->geoidSep,
8941 stn2_it->geoidSep,
8942 datum_.GetEllipsoidRef());
8943 break;
8944
8945 // Apply N value
8946 case 'H':
8947 case 'L':
8948 _it_msr->measAdj -= _it_msr->preAdjCorr;
8949 break;
8950
8951 // Apply correction for deflections of the vertical
8952 case 'A':
8953 case 'D':
8954 case 'I':
8955 case 'J':
8956 case 'K':
8957 case 'Z':
8958 // add deflection of the vertical to adjusted value
8959 _it_msr->measAdj += _it_msr->preAdjCorr;
8960 break;
8961 case 'V':
8962 // apply deflection of the vertical to the adjusted
8963 // measurement to get the commensurate measurement value
8964 _it_msr->measAdj -= _it_msr->preAdjCorr;
8965 break;
8966 }
8967
8968 _it_msr->measAdjPrec = v_precAdjMsrsFull_.at(block).get(precadjmsr_row, 0); // precision of adjusted measurement
8969 _it_msr->residualPrec = measPrec - _it_msr->measAdjPrec; // residual precision
8970
8971 // Often, residualPrec contains a very small negative
8972 // value, e.g. -1.5 e-35, effectively zero!
8973 // To circumvent errors arising from taking the square root
8974 // of a negative number, first compute the absolute value.
8975 // While this is theoretically incorrect, the impact is of no practical
8976 // consequence. P. Collier
8977 if (_it_msr->residualPrec < 0.0)
8978 _it_msr->residualPrec = fabs(_it_msr->residualPrec);
8979
8980 // Update Pelzer reliability, N-Stat, T-Stat
8981 UpdateMsrRecordStats(_it_msr, measPrec);
8982
8983 if (fabs(_it_msr->NStat) > criticalValue_)
8985}
void UpdateMsrRecordStats(it_vmsr_t &_it_msr, const double &measPrec)

References bstBinaryRecords_, criticalValue_, datum_, EllipsoidChordtoEllipsoidArc(), EllipsoidChordtoMSLArc(), dynadjust::math::matrix_2d::get(), GetBlkMatrixElemStn1(), GetBlkMatrixElemStn2(), potentialOutlierCount_, TWO_PI(), UpdateMsrRecordStats(), v_estimatedStations_, v_measMinusComp_, and v_precAdjMsrsFull_.

Referenced by fillSinexExample(), UpdateMsrRecords(), UpdateMsrRecords_D(), and UpdateMsrRecords_GXY().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrRecords_D()

void dynadjust::networkadjust::dna_adjust::UpdateMsrRecords_D ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & msr_row,
UINT32 & precadjmsr_row )
private

Definition at line 8819 of file dnaadjust.cpp.

8820{
8821 UINT32 a, angle_count(_it_msr->vectorCount2 - 1);
8822 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
8823
8824 // move to first direction record which contains the derived angles
8825 _it_msr++;
8826
8827 for (a=0; a<angle_count; ++a) // for each angle
8828 {
8829 // cater for ignored directions
8830 if (_it_msr->ignore)
8831 {
8832 while (skip < ignored)
8833 {
8834 skip++;
8835 _it_msr++;
8836 if (!_it_msr->ignore)
8837 break;
8838 }
8839 }
8840
8841 UpdateMsrRecord(block, _it_msr, msr_row, precadjmsr_row, _it_msr->scale2);
8842 _it_msr++;
8843 msr_row++;
8844 precadjmsr_row++;
8845 }
8846}

References UpdateMsrRecord().

Referenced by fillSinexExample(), and UpdateMsrRecords().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrRecords_GXY()

void dynadjust::networkadjust::dna_adjust::UpdateMsrRecords_GXY ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & msr_row,
UINT32 & precadjmsr_row )
private

Definition at line 8850 of file dnaadjust.cpp.

8851{
8852 UINT32 cluster_msr, cluster_count(_it_msr->vectorCount1);
8853 UINT32 covariance_count;
8854
8855 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
8856 {
8857 covariance_count = _it_msr->vectorCount2;
8858
8859 // X measurement
8860 UpdateMsrRecord(block, _it_msr, msr_row, precadjmsr_row, _it_msr->term2);
8861 _it_msr++;
8862 msr_row++;
8863 precadjmsr_row += 3;
8864
8865 // Y measurement
8866 UpdateMsrRecord(block, _it_msr, msr_row, precadjmsr_row, _it_msr->term3);
8867 _it_msr++;
8868 msr_row++;
8869 precadjmsr_row += 2;
8870
8871 // Z measurement
8872 UpdateMsrRecord(block, _it_msr, msr_row, precadjmsr_row, _it_msr->term4);
8873 msr_row++;
8874 precadjmsr_row++;
8875
8876 // skip covariances until next point
8877 _it_msr += covariance_count * 3;
8878
8879 if (covariance_count > 0)
8880 _it_msr++;
8881 }
8882}

References UpdateMsrRecord().

Referenced by fillSinexExample(), and UpdateMsrRecords().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateMsrRecordStats()

void dynadjust::networkadjust::dna_adjust::UpdateMsrRecordStats ( it_vmsr_t & _it_msr,
const double & measPrec )
private

Definition at line 8989 of file dnaadjust.cpp.

8990{
8991 _it_msr->PelzerRel = sqrt(measPrec) / sqrt(_it_msr->residualPrec);
8992 if (_it_msr->PelzerRel < 0. || _it_msr->PelzerRel > STABLE_LIMIT)
8993 _it_msr->PelzerRel = UNRELIABLE;
8994
8995 _it_msr->NStat = _it_msr->measCorr / sqrt(_it_msr->residualPrec);
8996}
const double UNRELIABLE(999.99)
const double STABLE_LIMIT(700.)

References STABLE_LIMIT(), and UNRELIABLE().

Referenced by fillSinexExample(), PrintAdjGNSSAlternateUnits(), and UpdateMsrRecord().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeGlobalPelzer()

void dynadjust::networkadjust::dna_adjust::ComputeGlobalPelzer ( )
private

Definition at line 9000 of file dnaadjust.cpp.

9001{
9002 UINT32 block, numMsr(0);
9003 double sum(0.);
9004
9005 it_vUINT32 _it_block_msr;
9006 it_vmsr_t _it_msr;
9007
9008 for (block=0; block<blockCount_; ++block)
9009 {
9010 for (_it_block_msr=v_CML_.at(block).begin();
9011 _it_block_msr!=v_CML_.at(block).end();
9012 ++_it_block_msr)
9013 {
9014 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
9015 continue;
9016
9017 switch (_it_msr->measType)
9018 {
9019 case 'D': // Direction set
9020 // When a target direction is found, continue to next element.
9021 if (_it_msr->vectorCount1 < 1)
9022 continue;
9023 ComputeGlobalPelzer_D(_it_msr, numMsr, sum);
9024 continue;
9025
9026 case 'G': // GPS Baseline (treat as single-baseline cluster)
9027 case 'X': // GPS Baseline cluster
9028 case 'Y': // GPS Point cluster
9029 ComputeGlobalPelzer_GXY(_it_msr, numMsr, sum);
9030 continue;
9031 }
9032
9033 // All measurement types
9034 if (_it_msr->PelzerRel > 0. && _it_msr->PelzerRel < STABLE_LIMIT)
9035 {
9036 sum += (_it_msr->PelzerRel * _it_msr->PelzerRel - 1.);
9037 numMsr++;
9038 }
9039 else
9040 _it_msr->PelzerRel = UNRELIABLE;
9041 }
9042
9043 switch (projectSettings_.a.adjust_mode)
9044 {
9045 case Phased_Block_1Mode:
9046 break;
9047 }
9048 }
9049
9050 // Ok, now compute Pelzer's global reliability
9051 if (numMsr > 0)
9052 globalPelzerReliability_ = sqrt(sum / numMsr);
9053 else
9055
9056}
void ComputeGlobalPelzer_GXY(it_vmsr_t &_it_msr, UINT32 &numMsr, double &sum)
void ComputeGlobalPelzer_D(it_vmsr_t &_it_msr, UINT32 &numMsr, double &sum)

References blockCount_, ComputeGlobalPelzer_D(), ComputeGlobalPelzer_GXY(), globalPelzerReliability_, InitialiseandValidateMsrPointer(), Phased_Block_1Mode, projectSettings_, STABLE_LIMIT(), UNRELIABLE(), and v_CML_.

Referenced by ComputeStatistics(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeGlobalPelzer_D()

void dynadjust::networkadjust::dna_adjust::ComputeGlobalPelzer_D ( it_vmsr_t & _it_msr,
UINT32 & numMsr,
double & sum )
private

Definition at line 9059 of file dnaadjust.cpp.

9060{
9061 UINT32 a, angle_count(_it_msr->vectorCount2 - 1);
9062 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
9063
9064 // move to first direction record which contains the derived angles
9065 _it_msr++;
9066
9067 for (a=0; a<angle_count; ++a) // for each angle
9068 {
9069 // cater for ignored directions
9070 if (_it_msr->ignore)
9071 {
9072 while (skip < ignored)
9073 {
9074 skip++;
9075 _it_msr++;
9076 if (!_it_msr->ignore)
9077 break;
9078 }
9079 }
9080
9081 if (_it_msr->PelzerRel > 0. && _it_msr->PelzerRel < UNRELIABLE)
9082 {
9083 sum += (_it_msr->PelzerRel * _it_msr->PelzerRel - 1.);
9084 numMsr++;
9085 }
9086 else
9087 _it_msr->PelzerRel = UNRELIABLE;
9088 _it_msr++;
9089 }
9090}

References UNRELIABLE().

Referenced by ComputeGlobalPelzer(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeGlobalPelzer_GXY()

void dynadjust::networkadjust::dna_adjust::ComputeGlobalPelzer_GXY ( it_vmsr_t & _it_msr,
UINT32 & numMsr,
double & sum )
private

Definition at line 9094 of file dnaadjust.cpp.

9095{
9096 UINT32 cluster_msr, cluster_count(_it_msr->vectorCount1);
9097 UINT32 covariance_count, i;
9098
9099 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
9100 {
9101 covariance_count = _it_msr->vectorCount2;
9102
9103 // X, Y, Z measurement
9104 for (i=0; i<3; ++i)
9105 {
9106 if (_it_msr->PelzerRel > 0. && _it_msr->PelzerRel < UNRELIABLE)
9107 {
9108 sum += (_it_msr->PelzerRel * _it_msr->PelzerRel - 1.);
9109 numMsr++;
9110 }
9111 else
9112 _it_msr->PelzerRel = UNRELIABLE;
9113
9114 if (i < 2)
9115 _it_msr++;
9116 }
9117
9118 // skip covariances until next point
9119 _it_msr += covariance_count * 3;
9120
9121 if (covariance_count > 0)
9122 _it_msr++;
9123 }
9124
9125}

References UNRELIABLE().

Referenced by ComputeGlobalPelzer(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquare_ABCEHIJKLMPQRSVZ()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquare_ABCEHIJKLMPQRSVZ ( const it_vmsr_t & _it_msr,
UINT32 & measurement_index,
matrix_2d * measMinusComp )
private

Definition at line 9128 of file dnaadjust.cpp.

9129{
9130 chiSquared_ +=
9131 measMinusComp->get(measurement_index, 0) *
9132 measMinusComp->get(measurement_index, 0) / _it_msr->term2;
9133
9134 measurement_index++;
9135}

References chiSquared_, and dynadjust::math::matrix_2d::get().

Referenced by ComputeChiSquare(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquare_D()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquare_D ( it_vmsr_t & _it_msr,
UINT32 & measurement_index,
matrix_2d * measMinusComp )
private

Definition at line 9138 of file dnaadjust.cpp.

9139{
9140 UINT32 a, angle_count(_it_msr->vectorCount2 - 1);
9141 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
9142
9143 // move to first direction record which contains the derived angles
9144 _it_msr++;
9145
9146 for (a=0; a<angle_count; ++a) // for each angle
9147 {
9148 // cater for ignored directions
9149 if (_it_msr->ignore)
9150 {
9151 while (skip < ignored)
9152 {
9153 skip++;
9154 _it_msr++;
9155 if (!_it_msr->ignore)
9156 break;
9157 }
9158 }
9159
9160 chiSquared_ +=
9161 measMinusComp->get(measurement_index, 0) *
9162 measMinusComp->get(measurement_index, 0) / _it_msr->scale2; //variance (angle)
9163
9164 measurement_index++;
9165 _it_msr++;
9166 }
9167}

References chiSquared_, and dynadjust::math::matrix_2d::get().

Referenced by ComputeChiSquare(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquare_G()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquare_G ( const it_vmsr_t & _it_msr,
UINT32 & measurement_index,
matrix_2d * measMinusComp )
private

Definition at line 9229 of file dnaadjust.cpp.

9230{
9231 matrix_2d V(3, 3); // a-priori measurements variance matrix
9232
9233 // 1. Form inverse variance matrix for GPS measurement
9234 FormInverseGPSVarianceMatrix(_it_msr, &V);
9235
9236 // 2. Form residuals matrix
9237 UINT32 row, col;
9238 double cs(0.);
9239 for (row=0; row<3; ++row)
9240 for (col=0; col<3; ++col)
9241 cs += V.get(row, col) *
9242 measMinusComp->get(measurement_index + row, 0) *
9243 measMinusComp->get(measurement_index + col, 0);
9244
9245 chiSquared_ += cs;
9246 measurement_index += 3;
9247}
void FormInverseGPSVarianceMatrix(const it_vmsr_t &_it_msr, matrix_2d *vmat)

References chiSquared_, FormInverseGPSVarianceMatrix(), and dynadjust::math::matrix_2d::get().

Referenced by ComputeChiSquare(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeChiSquare_XY()

void dynadjust::networkadjust::dna_adjust::ComputeChiSquare_XY ( const it_vmsr_t & _it_msr,
UINT32 & measurement_index,
matrix_2d * measMinusComp )
private

Definition at line 9250 of file dnaadjust.cpp.

9251{
9252 // compute At * Vm-1 * A
9253 UINT32 element_count(_it_msr->vectorCount1);
9254 UINT32 variance_dim(element_count * 3);
9255
9256 matrix_2d V(variance_dim, variance_dim); // a-priori measurements variance matrix
9257
9258 // 1. Form inverse variance matrix for GPS measurement
9259 FormInverseGPSVarianceMatrix(_it_msr, &V);
9260
9261 // 2. Form residuals matrix
9262 matrix_2d r(measMinusComp->submatrix(measurement_index, 0, variance_dim, 1));
9263
9264 matrix_2d rt(r.transpose());
9265 matrix_2d rt_Vinv(1, variance_dim);
9266 matrix_2d rt_Vinv_r(1, 1);
9267
9268 //rt_Vinv.multiply(rt, V);
9269 rt_Vinv.multiply(r, "T", V, "N");
9270
9271 //rt_Vinv_r.multiply(rt_Vinv, r);
9272 rt_Vinv_r.multiply(rt_Vinv, "N", r, "N");
9273
9274 chiSquared_ += rt_Vinv_r.get(0, 0);
9275 measurement_index += variance_dim;
9276}

References chiSquared_, FormInverseGPSVarianceMatrix(), dynadjust::math::matrix_2d::get(), dynadjust::math::matrix_2d::multiply(), dynadjust::math::matrix_2d::submatrix(), and dynadjust::math::matrix_2d::transpose().

Referenced by ComputeChiSquare(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FormInverseVarianceMatrix()

void dynadjust::networkadjust::dna_adjust::FormInverseVarianceMatrix ( matrix_2d * vmat,
bool LOWER_IS_CLEARED = false )
private

Definition at line 9170 of file dnaadjust.cpp.

9171{
9172 if (vmat->rows() == 1)
9173 {
9174 vmat->put(0, 0, 1./vmat->get(0, 0));
9175 return;
9176 }
9177
9178 // As of version 3.2.0, force all inversions to use MKL. This change
9179 // is enforced for two reasons:
9180 // 1. Sweep, Gaussian inverse and numerical recipes cholesky
9181 // all require matrix data to be stored in row wise fashion, upper
9182 // triangle only, whereas contiguous matrix class stores matrix data
9183 // in column wise fashion, lower triangle.
9184 // 2. Sweep, Gaussian never really offered a stable solution.
9185 // The following switch is kept in case future development warrants
9186 // re-offering the option to choose (in which case, those matrix inversion
9187 // functions must be revised to cater for column wise, lower triangular
9188 // order.
9189
9190 // TODO: All functions which load variance matrix from binary files
9191 // store the data in upper triangular form. This could be changed to
9192 // lower triangular form, thus alleviating the need to pass
9193 // LOWER_IS_CLEARED. That is, force all operations to use a lower
9194 // triangular matrix. Not sure if this would create an efficiency or not.
9195 switch (projectSettings_.a.inverse_method_msr)
9196 {
9197// case Gaussian:
9198// vmat->gaussianinverse();
9199// break;
9200// case Sweep:
9201// vmat->sweepinverse();
9202// break;
9203 case Cholesky_mkl:
9204 default:
9205 // Inversion using Intel MKL
9206 vmat->cholesky_inverse(LOWER_IS_CLEARED);
9207 break;
9208 // choleskyinverse broke once the storage order of the matrix buffer was
9209 // changed from row-wise to column wise.
9210// case Cholesky:
9211// default:
9212 // Inversion using Numerical Recipes
9213// vmat->choleskyinverse(LOWER_IS_CLEARED);
9214// break;
9215 }
9216}
matrix_2d cholesky_inverse(bool LOWER_IS_CLEARED=false)
@ Cholesky_mkl

References dynadjust::math::matrix_2d::cholesky_inverse(), Cholesky_mkl, dynadjust::math::matrix_2d::get(), projectSettings_, dynadjust::math::matrix_2d::put(), and dynadjust::math::matrix_2d::rows().

Referenced by CarryStnEstimatesandVariancesForward(), CarryStnEstimatesandVariancesReverse(), fillSinexExample(), FormConstraintStationVarianceMatrix(), FormInverseGPSVarianceMatrix(), LoadVarianceMatrix_D(), LoadVarianceMatrix_G(), LoadVarianceMatrix_X(), LoadVarianceMatrix_Y(), Solve(), and SolveMT().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FormInverseGPSVarianceMatrix()

void dynadjust::networkadjust::dna_adjust::FormInverseGPSVarianceMatrix ( const it_vmsr_t & _it_msr,
matrix_2d * vmat )
private

Definition at line 9219 of file dnaadjust.cpp.

9220{
9221 // 1. Get upper triangular a-priori measurements variance matrix
9222 GetGPSVarianceMatrix<it_vmsr_t>(_it_msr, vmat);
9223
9224 // 2. Inverse
9225 FormInverseVarianceMatrix(vmat, true);
9226}
void GetGPSVarianceMatrix(const msr_t_Iterator begin, matrix_2d *vmat)

References FormInverseVarianceMatrix(), and GetGPSVarianceMatrix().

Referenced by ComputeChiSquare_G(), ComputeChiSquare_XY(), fillSinexExample(), and FormInverseVarianceMatrixReduced().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FormInverseVarianceMatrixReduced()

bool dynadjust::networkadjust::dna_adjust::FormInverseVarianceMatrixReduced ( it_vmsr_t _it_msr,
matrix_2d * var_cart,
const std::string & method_name )
private

Definition at line 5196 of file dnaadjust.cpp.

5198{
5199 // Has the variance matrix already been reduced (i.e. propagated and scaled)
5200 if (bms_meta_.reduced)
5201 {
5202 try {
5203 // load as-is, assuming that an adjustment has been run
5204 // and the variances have been reduced (propagated and scaled)
5205 FormInverseGPSVarianceMatrix(_it_msr, var_cart);
5206 return true;
5207 }
5208 catch (const std::runtime_error& e) {
5209
5210 // Print error message to adj file and throw exception
5211 std::stringstream ss;
5212 PrintMsrVarianceMatrixException(_it_msr, e, ss, method_name);
5213 SignalExceptionAdjustment(ss.str(), 0);
5214 }
5215 }
5216 return false;
5217}

References bms_meta_, FormInverseGPSVarianceMatrix(), PrintMsrVarianceMatrixException(), and SignalExceptionAdjustment().

Referenced by fillSinexExample(), LoadVarianceMatrix_G(), LoadVarianceMatrix_X(), and LoadVarianceMatrix_Y().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintStatistics()

void dynadjust::networkadjust::dna_adjust::PrintStatistics ( bool printPelzer = true)
private

Definition at line 8423 of file dnaadjust.cpp.

8424{
8425 // print statistics
8426 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Number of unknown parameters" << std::fixed << std::setprecision(0) << unknownParams_;
8428 adj_file << " (All stations held constrained)";
8429 adj_file << std::endl;
8430
8431 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Number of measurements" << std::fixed << std::setprecision(0) << measurementParams_;
8432 if (potentialOutlierCount_ > 0)
8433 {
8434 adj_file << " (" << potentialOutlierCount_ << " potential outlier";
8435 if (potentialOutlierCount_ > 1)
8436 adj_file << "s";
8437 adj_file << ")";
8438 }
8439 adj_file << std::endl;
8440 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Degrees of freedom" << std::fixed << std::setprecision(0) << degreesofFreedom_ << std::endl;
8441 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Chi squared" << std::fixed << std::setprecision(2) << chiSquared_ << std::endl;
8442 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Rigorous Sigma Zero" << std::fixed << std::setprecision(3) << sigmaZero_ << std::endl;
8443 if (printPelzer)
8444 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Global (Pelzer) Reliability" << std::fixed << std::setw(8) << std::setprecision(3) << globalPelzerReliability_ <<
8445 "(excludes non redundant measurements)" << std::endl;
8446
8447 adj_file << std::endl;
8448
8449 std::stringstream ss("");
8450 ss << "Chi-Square test (" << std::setprecision(1) << std::fixed << projectSettings_.a.confidence_interval << "%)";
8451 adj_file << std::setw(PRINT_VAR_PAD) << std::left << ss.str();
8452 ss.str("");
8453 ss << std::fixed << std::setprecision(3) <<
8454 chiSquaredLowerLimit_ << " < " <<
8455 sigmaZero_ << " < " <<
8457 adj_file << std::setw(CHISQRLIMITS) << std::left << ss.str();
8458
8459 ss.str("");
8460 if (degreesofFreedom_ < 1)
8461 ss << "NO REDUNDANCY";
8462 else
8463 {
8464 ss << "*** ";
8465 switch (passFail_)
8466 {
8467 case test_stat_pass:
8468 ss << "PASSED"; // within upper and lower
8469 break;
8470 case test_stat_warning:
8471 ss << "WARNING"; // less than lower limit
8472 break;
8473 case test_stat_fail:
8474 ss << "FAILED"; // greater than upper limit
8475 break;
8476 }
8477 ss << " ***";
8478 }
8479 adj_file << std::setw(PASS_FAIL) << std::right << ss.str() << std::endl << std::endl;
8480}
const UINT32 PASS_FAIL(16)
const UINT32 CHISQRLIMITS(OUTPUTLINELENGTH - PRINT_VAR_PAD - PASS_FAIL)

References adj_file, allStationsFixed_, CHISQRLIMITS(), chiSquared_, chiSquaredLowerLimit_, chiSquaredUpperLimit_, degreesofFreedom_, globalPelzerReliability_, measurementParams_, PASS_FAIL(), passFail_, potentialOutlierCount_, PRINT_VAR_PAD(), projectSettings_, sigmaZero_, test_stat_fail, test_stat_pass, test_stat_warning, and unknownParams_.

Referenced by AdjustPhased(), AdjustSimultaneous(), fillSinexExample(), and GenerateStatistics().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OpenOutputFileStreams()

void dynadjust::networkadjust::dna_adjust::OpenOutputFileStreams ( )
private

Definition at line 9279 of file dnaadjust.cpp.

9280{
9281 try {
9282 // Create adj file. Throws runtime_error on failure.
9284 }
9285 catch (const std::runtime_error& e) {
9286 SignalExceptionAdjustment(e.what(), 0);
9287 }
9288
9289 try {
9290 // Create xyz file. Throws runtime_error on failure.
9292 }
9293 catch (const std::runtime_error& e) {
9294 SignalExceptionAdjustment(e.what(), 0);
9295 }
9296
9297 if (projectSettings_.g.verbose > 0)
9298 {
9299 std::string debug_output_file =
9300 projectSettings_.g.output_folder + FOLDER_SLASH + projectSettings_.g.network_name;
9301
9302 switch (projectSettings_.a.adjust_mode)
9303 {
9304 case Phased_Block_1Mode:
9305 case PhasedMode:
9306
9307 debug_output_file += ".phased";
9308
9309 if (projectSettings_.a.adjust_mode == Phased_Block_1Mode)
9310 debug_output_file += "-block1";
9311 else if (projectSettings_.a.stage)
9312 debug_output_file += "-stage";
9313 else if (projectSettings_.a.multi_thread)
9314 debug_output_file += "-mt";
9315 break;
9316 case SimultaneousMode:
9317 debug_output_file += ".simult";
9318 break;
9319 }
9320
9321 debug_output_file += ".dbg";
9322
9323 try {
9324 // Create debug file. Throws runtime_error on failure.
9325 file_opener(debug_file, debug_output_file);
9326 }
9327 catch (const std::runtime_error& e) {
9328 SignalExceptionAdjustment(e.what(), 0);
9329 }
9330 }
9331
9332 if (projectSettings_.a.stage)
9333 {
9336 }
9337}

References adj_file, debug_file, file_opener(), OpenStageFileStreams(), Phased_Block_1Mode, PhasedMode, projectSettings_, ReserveBlockMapRegions(), SignalExceptionAdjustment(), SimultaneousMode, and xyz_file.

Referenced by fillSinexExample(), and PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintOutputFileHeaderInfo()

void dynadjust::networkadjust::dna_adjust::PrintOutputFileHeaderInfo ( )
private

Definition at line 9339 of file dnaadjust.cpp.

9340{
9341 // Print formatted header
9342 print_file_header(adj_file, "DYNADJUST ADJUSTMENT OUTPUT FILE");
9343 // Print formatted header
9344 print_file_header(xyz_file, "DYNADJUST COORDINATE OUTPUT FILE");
9345
9346 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "File name:" << boost::filesystem::system_complete(projectSettings_.o._adj_file).string() << std::endl << std::endl;
9347 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "File name:" << boost::filesystem::system_complete(projectSettings_.o._xyz_file).string() << std::endl << std::endl;
9348
9349 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Command line arguments: ";
9350 adj_file << projectSettings_.a.command_line_arguments << std::endl << std::endl;
9351
9352 if (projectSettings_.i.input_files.empty())
9353 {
9354 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Stations file:" << boost::filesystem::system_complete(projectSettings_.a.bst_file).string() << std::endl;
9355 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Measurements file:" << boost::filesystem::system_complete(projectSettings_.a.bms_file).string() << std::endl;
9356 }
9357 else
9358 {
9359 _it_vstr _it_files(projectSettings_.i.input_files.begin());
9360 std::string s("Input files:");
9361 while (_it_files!=projectSettings_.i.input_files.end())
9362 {
9363 adj_file << std::setw(PRINT_VAR_PAD) << std::left << s << *_it_files++ << std::endl;
9364 s = " ";
9365 }
9366 }
9367
9368 // Reference frame
9369 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Reference frame: " << datum_.GetName() << std::endl;
9370 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Reference frame: " << datum_.GetName() << std::endl;
9371 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Epoch: " << datum_.GetEpoch_s() << std::endl;
9372 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Epoch: " << datum_.GetEpoch_s() << std::endl;
9373
9374
9375 // Geoid model
9376 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Geoid model: " << boost::filesystem::system_complete(projectSettings_.n.ntv2_geoid_file).string() << std::endl;
9377 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Geoid model: " << boost::filesystem::system_complete(projectSettings_.n.ntv2_geoid_file).string() << std::endl;
9378
9379
9380 switch (projectSettings_.a.adjust_mode)
9381 {
9382 case PhasedMode:
9383 case Phased_Block_1Mode:
9384 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Segmentation file:" << projectSettings_.a.seg_file << std::endl;
9385 }
9386
9387 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Constrained Station S.D. (m):" << projectSettings_.a.fixed_std_dev << std::endl;
9388 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Free Station S.D. (m):" << projectSettings_.a.free_std_dev << std::endl;
9389 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Iteration threshold:" << projectSettings_.a.iteration_threshold << std::endl;
9390 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Maximum iterations:" << std::setprecision(0) << std::fixed << projectSettings_.a.max_iterations << std::endl;
9391 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Test confidence interval:" << std::setprecision(1) << std::fixed << projectSettings_.a.confidence_interval << "%" << std::endl;
9392 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Uncertainties SD(e,n,up):" << std::setprecision(1) << "68.3% (1 sigma)" << std::endl;
9393
9394 if (!projectSettings_.a.station_constraints.empty())
9395 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Station constraints:" << projectSettings_.a.station_constraints << std::endl;
9396
9397 trimstr(projectSettings_.a.comments);
9398
9399 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Station coordinate types:";
9400 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Station coordinate types:";
9401
9402 adj_file << projectSettings_.o._stn_coord_types << std::endl;
9403 xyz_file << projectSettings_.o._stn_coord_types << std::endl;
9404
9405 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Stations printed in blocks:";
9406 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Stations printed in blocks:";
9407 if (projectSettings_.a.adjust_mode != SimultaneousMode &&
9408 projectSettings_.o._output_stn_blocks)
9409 {
9410 adj_file << "Yes" << std::endl;
9411 xyz_file << "Yes" << std::endl;
9412 }
9413 else
9414 {
9415 adj_file << "No" << std::endl;
9416 xyz_file << "No" << std::endl;
9417 }
9418
9419 if (projectSettings_.o._stn_corr)
9420 {
9421 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Station coordinate corrections:" <<
9422 "Yes" << std::endl;
9423 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Station coordinate corrections:" <<
9424 "Yes" << std::endl;
9425 }
9426
9427 if (projectSettings_.o._apply_type_b_file || projectSettings_.o._apply_type_b_global)
9428 {
9429 if (projectSettings_.o._apply_type_b_global)
9430 {
9431 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Type B uncertainties:" <<
9432 projectSettings_.a.type_b_global << std::endl;
9433 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Type B uncertainties:" <<
9434 projectSettings_.a.type_b_global << std::endl;
9435 }
9436
9437 if (projectSettings_.o._apply_type_b_file)
9438 {
9439 adj_file << std::setw(PRINT_VAR_PAD) << std::left << "Type B uncertainty file:" <<
9440 boost::filesystem::system_complete(projectSettings_.a.type_b_file).string() << std::endl;
9441 xyz_file << std::setw(PRINT_VAR_PAD) << std::left << "Type B uncertainty file:" <<
9442 boost::filesystem::system_complete(projectSettings_.a.type_b_file).string() << std::endl;
9443 }
9444 }
9445
9446 // Print user-supplied comments.
9447 // This is a bit messy and could be cleaned up.
9448 // Alas, the following logic is applied:
9449 // - User-supplied newlines (i.e. "\n" within the string) are dealt with
9450 // - Newline characters are inserted at between-word-spaces, such that the
9451 // line length does not exceed PRINT_VAL_PAD
9452 // - Resulting spaces at the start of a sentence on a new line are removed.
9453 if (!projectSettings_.a.comments.empty())
9454 {
9455 size_t s(0), t(0);
9456 std::string var("Comments: "), comments(projectSettings_.a.comments);
9457 size_t pos = 0;
9458
9459 while (s < comments.length())
9460 {
9461 if (s + PRINT_VAL_PAD >= comments.length())
9462 {
9463 adj_file << std::setw(PRINT_VAR_PAD) << std::left << var << comments.substr(s) << std::endl;
9464 break;
9465 }
9466 else
9467 {
9468 if ((pos = comments.substr(s, PRINT_VAL_PAD-1).find('\\')) != std::string::npos)
9469 {
9470 if (comments.at(s+pos+1) == 'n')
9471 {
9472 adj_file << std::setw(PRINT_VAR_PAD) << std::left << var << comments.substr(s, pos) << std::endl;
9473 s += pos+2;
9474 if (comments.at(s) == ' ')
9475 ++s;
9476 var = " ";
9477 continue;
9478 }
9479 }
9480
9481 t = 0;
9482 while (comments.at(s+PRINT_VAL_PAD - t) != ' ')
9483 ++t;
9484
9485 adj_file << std::setw(PRINT_VAR_PAD) << std::left << var << comments.substr(s, PRINT_VAL_PAD - t);
9486 s += PRINT_VAL_PAD - t;
9487
9488 if (comments.at(s-1) != ' ' &&
9489 comments.at(s) != ' ' &&
9490 comments.at(s+1) != ' ')
9491 adj_file << "-";
9492 else if (comments.at(s) == ' ')
9493 ++s;
9494 adj_file << std::endl;
9495 }
9496 var = " ";
9497 }
9498 }
9499
9500 adj_file << OUTPUTLINE << std::endl;
9501 xyz_file << OUTPUTLINE << std::endl;
9502}
const UINT32 PRINT_VAL_PAD(45)
T trimstr(T &Src)

References adj_file, datum_, OUTPUTLINE, Phased_Block_1Mode, PhasedMode, print_file_header(), PRINT_VAL_PAD(), PRINT_VAR_PAD(), projectSettings_, SimultaneousMode, trimstr(), and xyz_file.

Referenced by PrepareAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements ( const UINT32 & block,
const std::string & msg = "" )
private

Definition at line 10539 of file dnaadjust.cpp.

10540{
10541 // Print header
10542 std::string table_heading("Computed Measurements");
10543 std::string col_heading("Computed");
10544
10545 if (projectSettings_.a.adjust_mode == PhasedMode || !type.empty())
10546 {
10547 std::stringstream ss;
10548 ss << " (";
10549 if (projectSettings_.a.adjust_mode == PhasedMode)
10550 {
10551 ss << "Block " << block + 1;
10552 if (!type.empty())
10553 ss << ", ";
10554 }
10555
10556 if (!type.empty())
10557 ss << type;
10558
10559 ss << ")";
10560
10561 table_heading.append(ss.str());
10562 }
10563
10564 PrintAdjMeasurementsHeader(true, table_heading,
10565 computedMsrs, block, false);
10566
10567 it_vUINT32 _it_block_msr;
10568 it_vmsr_t _it_msr;
10569
10570 UINT32 design_row(0);
10571
10572 for (_it_block_msr=v_CML_.at(block).begin(); _it_block_msr!=v_CML_.at(block).end(); ++_it_block_msr)
10573 {
10574 if (InitialiseandValidateMsrPointer(_it_block_msr, _it_msr))
10575 continue;
10576
10577 // When a target direction is found, continue to next element.
10578 if (_it_msr->measType == 'D')
10579 if (_it_msr->vectorCount1 < 1)
10580 continue;
10581
10582 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
10583
10584 // normal format
10585 switch (_it_msr->measType)
10586 {
10587 case 'A': // Horizontal angle
10588 PrintCompMeasurements_A(block, _it_msr, design_row, computedMsrs);
10589 break;
10590 case 'B': // Geodetic azimuth
10591 case 'K': // Astronomic azimuth
10592 case 'V': // Zenith distance
10593 case 'Z': // Vertical angle
10594 PrintCompMeasurements_BKVZ(block, _it_msr, design_row, computedMsrs);
10595 break;
10596 case 'C': // Chord dist
10597 case 'E': // Ellipsoid arc
10598 case 'L': // Level difference
10599 case 'M': // MSL arc
10600 case 'S': // Slope distance
10601 PrintCompMeasurements_CELMS(_it_msr, design_row, computedMsrs);
10602 break;
10603 case 'D': // Direction set
10604 PrintCompMeasurements_D(_it_msr, design_row);
10605 break;
10606 case 'H': // Orthometric height
10607 case 'R': // Ellipsoidal height
10608 PrintCompMeasurements_HR(block, _it_msr, design_row, computedMsrs);
10609 break;
10610 case 'I': // Astronomic latitude
10611 case 'J': // Astronomic longitude
10612 case 'P': // Geodetic latitude
10613 case 'Q': // Geodetic longitude
10614 PrintCompMeasurements_IJPQ(block, _it_msr, design_row, computedMsrs);
10615 break;
10616 case 'G': // GPS Baseline (treat as single-baseline cluster)
10617 case 'X': // GPS Baseline cluster
10618 case 'Y': // GPS Point cluster
10619 PrintCompMeasurements_GXY(block, _it_msr, design_row, computedMsrs);
10620 break;
10621 }
10622
10623 }
10624
10625 adj_file << std::endl << std::endl;
10626}
void PrintCompMeasurements_GXY(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
void PrintCompMeasurements_BKVZ(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
void PrintCompMeasurements_HR(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
void PrintCompMeasurements_A(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
void PrintCompMeasurements_D(it_vmsr_t &_it_msr, UINT32 &design_row, bool printIgnored=false)
void PrintCompMeasurements_IJPQ(const UINT32 &block, it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
void PrintAdjMeasurementsHeader(bool printHeader, const std::string &table_heading, printMeasurementsMode printMode, UINT32 block, bool printBlocks=false)
void PrintCompMeasurements_CELMS(it_vmsr_t &_it_msr, UINT32 &design_row, printMeasurementsMode printMode)
const UINT16 PAD2(2)
@ computedMsrs

References adj_file, computedMsrs, InitialiseandValidateMsrPointer(), PAD2(), PhasedMode, PrintAdjMeasurementsHeader(), PrintCompMeasurements_A(), PrintCompMeasurements_BKVZ(), PrintCompMeasurements_CELMS(), PrintCompMeasurements_D(), PrintCompMeasurements_GXY(), PrintCompMeasurements_HR(), PrintCompMeasurements_IJPQ(), projectSettings_, and v_CML_.

Referenced by AdjustPhasedForward(), AdjustSimultaneous(), and fillSinexExample().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurementsAngular()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurementsAngular ( const char cardinal,
const double & computed,
const double & correction,
const it_vmsr_t & _it_msr )
private

Definition at line 12406 of file dnaadjust.cpp.

12407{
12408 // Print computed angular measurements
12409 PrintMeasurementsAngular(cardinal, computed, correction, _it_msr, false);
12410
12411 // Print measurement correction
12412 PrintMeasurementCorrection(cardinal, _it_msr);
12413
12414 // Print measurement database ids
12415 if (projectSettings_.o._database_ids)
12417
12418 adj_file << std::endl;
12419}
void PrintMeasurementDatabaseID(const it_vmsr_t &_it_msr, bool initialise_dbindex=true)
void PrintMeasurementCorrection(const char cardinal, const it_vmsr_t &_it_msr)
void PrintMeasurementsAngular(const char cardinal, const double &measurement, const double &correction, const it_vmsr_t &_it_msr, bool printAdjMsr=true)

References adj_file, PrintMeasurementCorrection(), PrintMeasurementDatabaseID(), PrintMeasurementsAngular(), and projectSettings_.

Referenced by fillSinexExample(), PrintCompMeasurements_A(), PrintCompMeasurements_BKVZ(), PrintCompMeasurements_D(), PrintCompMeasurements_IJPQ(), and PrintCompMeasurements_YLLH().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurementsLinear()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurementsLinear ( const char cardinal,
const double & computed,
const double & correction,
const it_vmsr_t & _it_msr )
private

Definition at line 12422 of file dnaadjust.cpp.

12423{
12424 // If a user wants to print apriori computed measurements, via
12425 // --output-iter-cmp-msr
12426 // it is likely an attempt is being made to diagnose a problematic
12427 // adjustment. For this cause, test if a linear measurement correction
12428 // is in the order of 1 Km
12430 isAdjustmentQuestionable_ = (fabs(correction) > 999.9999);
12431
12432 // Print computed linear measurements
12433 PrintMeasurementsLinear(cardinal, computed, correction, _it_msr, false);
12434
12435 // Print measurement correction
12436 PrintMeasurementCorrection(cardinal, _it_msr);
12437
12438 // Print measurement database ids
12439 if (projectSettings_.o._database_ids)
12441
12442 adj_file << std::endl;
12443}
void PrintMeasurementsLinear(const char cardinal, const double &measurement, const double &correction, const it_vmsr_t &_it_msr, bool printAdjMsr=true)

References adj_file, isAdjustmentQuestionable_, PrintMeasurementCorrection(), PrintMeasurementDatabaseID(), PrintMeasurementsLinear(), and projectSettings_.

Referenced by fillSinexExample(), PrintCompMeasurements_CELMS(), PrintCompMeasurements_GXY(), PrintCompMeasurements_HR(), and PrintCompMeasurements_YLLH().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_A()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_A ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
printMeasurementsMode printMode )
private

Definition at line 12446 of file dnaadjust.cpp.

12447{
12448 // normal format
12449 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12450 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
12451 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station3).stationName;
12452
12453 double computed, correction;
12454 switch (printMode)
12455 {
12456 case computedMsrs:
12457 correction = -v_measMinusComp_.at(block).get(design_row, 0);
12458 computed = _it_msr->term1 + correction + _it_msr->preAdjCorr;
12459 break;
12460 case ignoredMsrs:
12461 default:
12462 correction = _it_msr->measCorr;
12463 computed = _it_msr->measAdj;
12464 break;
12465 }
12466
12467 // Print angular measurement, taking care of user requirements for
12468 // type, format and precision
12469 PrintCompMeasurementsAngular(' ', computed, correction, _it_msr);
12470
12471 design_row++;
12472}
void PrintCompMeasurementsAngular(const char cardinal, const double &computed, const double &correction, const it_vmsr_t &_it_msr)
const UINT16 STATION(20)
@ ignoredMsrs

References adj_file, bstBinaryRecords_, computedMsrs, ignoredMsrs, PrintCompMeasurementsAngular(), STATION(), and v_measMinusComp_.

Referenced by fillSinexExample(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_CELMS()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_CELMS ( it_vmsr_t & _it_msr,
UINT32 & design_row,
printMeasurementsMode printMode )
private

Definition at line 12504 of file dnaadjust.cpp.

12505{
12506 // normal format
12507 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12508 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
12509 adj_file << std::left << std::setw(STATION) << " ";
12510
12511 double computed;
12512 switch (printMode)
12513 {
12514 case computedMsrs:
12515 computed = _it_msr->term1 - _it_msr->measCorr - _it_msr->preAdjCorr;
12516 break;
12517 case ignoredMsrs:
12518 default:
12519 computed = _it_msr->measAdj;
12520 break;
12521 }
12522
12523 // Print linear measurement, taking care of user requirements for precision
12524 PrintCompMeasurementsLinear(' ', computed, _it_msr->measCorr, _it_msr);
12525
12526 design_row++;
12527}
void PrintCompMeasurementsLinear(const char cardinal, const double &computed, const double &correction, const it_vmsr_t &_it_msr)

References adj_file, bstBinaryRecords_, computedMsrs, ignoredMsrs, PrintCompMeasurementsLinear(), and STATION().

Referenced by fillSinexExample(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_D()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_D ( it_vmsr_t & _it_msr,
UINT32 & design_row,
bool printIgnored = false )
private

Definition at line 12533 of file dnaadjust.cpp.

12534{
12535 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
12536
12537 // normal format
12538 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12539 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
12540 adj_file << std::left << std::setw(STATION) << " ";
12541
12542 double computed;
12543
12544 std::string ignoreFlag(" ");
12545 if (_it_msr->ignore)
12546 ignoreFlag = "*";
12547
12548 UINT32 angle_count;
12549 if (printIgnored)
12550 angle_count = _it_msr->vectorCount1 - 1;
12551 else
12552 angle_count = _it_msr->vectorCount2 - 1;
12553
12554 adj_file << std::setw(PAD3) << std::left << ignoreFlag << std::setw(PAD2) << std::left << angle_count;
12555
12556 // Print measurement database ids
12557 if (projectSettings_.o._database_ids)
12558 {
12559 // Measured + Computed + Correction + Meas SD + Pre Adj Corr
12560 UINT32 b(MSR + MSR + CORR + PREC + PACORR);
12561 adj_file << std::setw(b) << " ";
12562
12564 }
12565 adj_file << std::endl;
12566
12567 _it_msr++;
12568
12569 for (UINT32 a(0); a<angle_count; ++a)
12570 {
12571 // Skip over ignored directions if the direction set is not ignored.
12572 // If the direction set is ignored, and --output-ignored-msrs option is supplied, then
12573 // don't skip (i.e. continue with printing all ignored directions in the set)
12574 if (_it_msr->ignore && !printIgnored)
12575 {
12576 while (skip < ignored)
12577 {
12578 skip++;
12579 _it_msr++;
12580 if (!_it_msr->ignore)
12581 break;
12582 }
12583 }
12584
12585 computed = _it_msr->term1 + _it_msr->measCorr;
12586
12587 adj_file << std::left << std::setw(PAD2) << " "; // measurement type
12588 adj_file << std::left << std::setw(STATION) << " "; // station1 (Instrument)
12589 adj_file << std::left << std::setw(STATION) << " "; // station2 (RO)
12590 adj_file << std::left << std::setw(STATION) <<
12591 bstBinaryRecords_.at(_it_msr->station2).stationName; // target
12592
12593 // Print angular measurement, taking care of user requirements for
12594 // type, format and precision
12595 PrintCompMeasurementsAngular(' ', computed, _it_msr->measCorr, _it_msr);
12596
12597 design_row++;
12598 _it_msr++;
12599 }
12600}
const UINT16 CORR(12)
const UINT16 PACORR(14)
const UINT16 PAD3(3)
const UINT16 MSR(19)
const UINT16 PREC(13)

References adj_file, bstBinaryRecords_, CORR(), MSR(), PACORR(), PAD2(), PAD3(), PREC(), PrintCompMeasurementsAngular(), PrintMeasurementDatabaseID(), projectSettings_, and STATION().

Referenced by fillSinexExample(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_HR()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_HR ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
printMeasurementsMode printMode )
private

Definition at line 12793 of file dnaadjust.cpp.

12794{
12795 // normal format
12796 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12797 adj_file << std::left << std::setw(STATION) << " ";
12798 adj_file << std::left << std::setw(STATION) << " ";
12799
12800 double computed, correction;
12801
12802 switch (printMode)
12803 {
12804 case computedMsrs:
12805 correction = -v_measMinusComp_.at(block).get(design_row, 0);
12806 computed = _it_msr->term1 + correction - _it_msr->preAdjCorr;
12807 break;
12808 case ignoredMsrs:
12809 default:
12810 correction = _it_msr->measCorr;
12811 computed = _it_msr->measAdj;
12812 break;
12813 }
12814
12815 // Print linear measurement, taking care of user requirements for precision
12816 PrintCompMeasurementsLinear(' ', computed, correction, _it_msr);
12817
12818 design_row++;
12819}

References adj_file, bstBinaryRecords_, computedMsrs, ignoredMsrs, PrintCompMeasurementsLinear(), STATION(), and v_measMinusComp_.

Referenced by fillSinexExample(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_IJPQ()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_IJPQ ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
printMeasurementsMode printMode )
private

Definition at line 12822 of file dnaadjust.cpp.

12823{
12824 // normal format
12825 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12826 adj_file << std::left << std::setw(STATION) << " ";
12827 adj_file << std::left << std::setw(STATION) << " ";
12828
12829 double computed, correction;
12830
12831 switch (printMode)
12832 {
12833 case computedMsrs:
12834 correction = -v_measMinusComp_.at(block).get(design_row, 0);
12835 computed = _it_msr->term1 + correction + _it_msr->preAdjCorr;
12836 break;
12837 case ignoredMsrs:
12838 default:
12839 correction = _it_msr->measCorr;
12840 computed = _it_msr->measAdj;
12841 break;
12842 }
12843
12844 // Print angular measurement, taking care of user requirements for
12845 // type, format and precision
12846 PrintCompMeasurementsAngular(' ', computed, correction, _it_msr);
12847
12848 design_row++;
12849}

References adj_file, bstBinaryRecords_, computedMsrs, ignoredMsrs, PrintCompMeasurementsAngular(), STATION(), and v_measMinusComp_.

Referenced by fillSinexExample(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_BKVZ()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_BKVZ ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
printMeasurementsMode printMode )
private

Definition at line 12475 of file dnaadjust.cpp.

12476{
12477 // normal format
12478 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12479 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
12480 adj_file << std::left << std::setw(STATION) << " ";
12481
12482 double computed, correction;
12483 switch (printMode)
12484 {
12485 case computedMsrs:
12486 correction = -v_measMinusComp_.at(block).get(design_row, 0);
12487 computed = _it_msr->term1 + correction + _it_msr->preAdjCorr;
12488 break;
12489 case ignoredMsrs:
12490 default:
12491 correction = _it_msr->measCorr;
12492 computed = _it_msr->measAdj;
12493 break;
12494 }
12495
12496 // Print angular measurement, taking care of user requirements for
12497 // type, format and precision
12498 PrintCompMeasurementsAngular(' ', computed, correction, _it_msr);
12499
12500 design_row++;
12501}

References adj_file, bstBinaryRecords_, computedMsrs, ignoredMsrs, PrintCompMeasurementsAngular(), STATION(), and v_measMinusComp_.

Referenced by fillSinexExample(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_GXY()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_GXY ( const UINT32 & block,
it_vmsr_t & _it_msr,
UINT32 & design_row,
printMeasurementsMode printMode )
private

Definition at line 12684 of file dnaadjust.cpp.

12685{
12686 // Is this a Y cluster specified in latitude, longitude, height?
12687 if (_it_msr->measType == 'Y')
12688 {
12689 if (_it_msr->station3 == LLH_type_i)
12690 {
12691 // Print phi, lambda, H
12692 PrintCompMeasurements_YLLH(_it_msr, design_row);
12693 return;
12694 }
12695 }
12696
12697 UINT32 cluster_msr, cluster_count(_it_msr->vectorCount1);
12698 UINT32 covariance_count;
12699 bool nextElement(false);
12700 double computed, correction;
12701
12702 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
12703 {
12704 if (nextElement)
12705 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
12706 else
12707 nextElement = true;
12708
12709 covariance_count = _it_msr->vectorCount2;
12710
12711 // first station
12712 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12713
12714 // Print second station?
12715 switch (_it_msr->measType)
12716 {
12717 case 'G':
12718 case 'X':
12719 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
12720 break;
12721 default:
12722 adj_file << std::left << std::setw(STATION) << " ";
12723 }
12724
12725 // third station
12726 adj_file << std::left << std::setw(STATION) << " ";
12727
12728 switch (printMode)
12729 {
12730 case computedMsrs:
12731 correction = -v_measMinusComp_.at(block).get(design_row, 0);
12732 computed = _it_msr->term1 + correction;
12733 break;
12734 case ignoredMsrs:
12735 default:
12736 correction = _it_msr->measCorr;
12737 computed = _it_msr->measAdj;
12738 break;
12739 }
12740
12741 // Print linear measurement, taking care of user requirements for precision
12742 PrintCompMeasurementsLinear('X', computed, correction, _it_msr);
12743
12744 design_row++;
12745 _it_msr++;
12746
12747 switch (printMode)
12748 {
12749 case computedMsrs:
12750 correction = -v_measMinusComp_.at(block).get(design_row, 0);
12751 computed = _it_msr->term1 + correction;
12752 break;
12753 case ignoredMsrs:
12754 default:
12755 correction = _it_msr->measCorr;
12756 computed = _it_msr->measAdj;
12757 break;
12758 }
12759
12760 // Print linear measurement, taking care of user requirements for precision
12761 PrintCompMeasurementsLinear('Y', computed, correction, _it_msr);
12762
12763 design_row++;
12764 _it_msr++;
12765
12766 switch (printMode)
12767 {
12768 case computedMsrs:
12769 correction = -v_measMinusComp_.at(block).get(design_row, 0);
12770 computed = _it_msr->term1 + correction;
12771 break;
12772 case ignoredMsrs:
12773 default:
12774 correction = _it_msr->measCorr;
12775 computed = _it_msr->measAdj;
12776 break;
12777 }
12778
12779 // Print linear measurement, taking care of user requirements for precision
12780 PrintCompMeasurementsLinear('Z', computed, correction, _it_msr);
12781
12782 design_row++;
12783
12784 // skip covariances until next point
12785 _it_msr += covariance_count * 3;
12786
12787 if (covariance_count > 0)
12788 _it_msr++;
12789 }
12790}
void PrintCompMeasurements_YLLH(it_vmsr_t &_it_msr, UINT32 &design_row)

References adj_file, bstBinaryRecords_, computedMsrs, ignoredMsrs, LLH_type_i, PAD2(), PrintCompMeasurements_YLLH(), PrintCompMeasurementsLinear(), STATION(), and v_measMinusComp_.

Referenced by fillSinexExample(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCompMeasurements_YLLH()

void dynadjust::networkadjust::dna_adjust::PrintCompMeasurements_YLLH ( it_vmsr_t & _it_msr,
UINT32 & design_row )
private

Definition at line 12603 of file dnaadjust.cpp.

12604{
12605 // create a temporary copy of this Y measurement and transform/propagate
12606 // cartesian elements to geographic
12607 vmsr_t y_msr;
12609
12610 it_vmsr_t _it_y_msr(y_msr.begin());
12611 snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
12612
12613 UINT32 cluster_msr, cluster_count(_it_y_msr->vectorCount1), covariance_count;
12614 matrix_2d mpositions(cluster_count * 3, 1);
12615
12616 it_vstn_t stn1_it;
12617
12618 // 1. Convert coordinates from cartesian to geographic
12620
12621 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
12622 design_row += 3;
12623
12624 _it_y_msr = y_msr.begin();
12625
12626 matrix_2d var_cart_adj(3, 3), var_geo_adj(3, 3);
12627
12628 // 2. Convert apriori measurement precisions
12629
12630 // Get measurement cartesian variance matrix
12631 matrix_2d var_cart;
12632 GetGPSVarianceMatrix(_it_y_msr, &var_cart);
12633 var_cart.filllower();
12634
12635 // Propagate the cartesian variance matrix to geographic
12637 mpositions,
12638 datum_.GetEllipsoidRef(),
12639 false); // Cartesian -> Geographic
12640
12641 SetGPSVarianceMatrix(_it_y_msr, var_cart);
12642
12643 // Now print the temporary measurement
12644 bool nextElement(false);
12645
12646 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
12647 {
12648 stn1_it = bstBinaryRecords_.begin() + _it_y_msr->station1;
12649
12650 if (nextElement)
12651 adj_file << std::left << std::setw(PAD2) << _it_y_msr->measType;
12652 else
12653 nextElement = true;
12654
12655 covariance_count = _it_y_msr->vectorCount2;
12656
12657 // first, second, third stations
12658 adj_file << std::left << std::setw(STATION) <<
12659 stn1_it->stationName <<
12660 std::left << std::setw(STATION) << " " << // second station
12661 std::left << std::setw(STATION) << " "; // third station
12662
12663 // Print latitude
12664 PrintCompMeasurementsAngular('P', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
12665
12666 // Print longitude
12667 _it_y_msr++;
12668 PrintCompMeasurementsAngular('L', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
12669
12670 // Print height
12671 _it_y_msr++;
12672 PrintCompMeasurementsLinear('H', _it_y_msr->measAdj, _it_y_msr->measCorr, _it_y_msr);
12673
12674 // skip covariances until next point
12675 _it_y_msr += covariance_count * 3;
12676
12677 if (covariance_count > 0)
12678 _it_y_msr++;
12679 }
12680
12681}
void ReduceYLLHMeasurementsforPrinting(vmsr_t &y_msr, matrix_2d &mpositions, printMeasurementsMode print_mode)
const char *const LLH_type("LLH")
void CopyClusterMsr(T &cluster, const msriterator _it_msr, T &clusterCopy)
const UINT16 STN_TYPE_WIDTH(4)

References adj_file, bmsBinaryRecords_, bstBinaryRecords_, computedMsrs, CopyClusterMsr(), datum_, dynadjust::math::matrix_2d::filllower(), GetGPSVarianceMatrix(), LLH_type(), PAD2(), PrintCompMeasurementsAngular(), PrintCompMeasurementsLinear(), PropagateVariances_GeoCart_Cluster(), ReduceYLLHMeasurementsforPrinting(), SetGPSVarianceMatrix(), STATION(), and STN_TYPE_WIDTH().

Referenced by fillSinexExample(), and PrintCompMeasurements_GXY().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintMeasurementsAngular()

void dynadjust::networkadjust::dna_adjust::PrintMeasurementsAngular ( const char cardinal,
const double & measurement,
const double & correction,
const it_vmsr_t & _it_msr,
bool printAdjMsr = true )
private

Definition at line 12851 of file dnaadjust.cpp.

12852{
12853 std::string ignoreFlag(" ");
12854
12855 double preAdjMeas(_it_msr->preAdjMeas);
12856 double adjMeas(measurement);
12857
12858 switch (_it_msr->measType)
12859 {
12860 case 'D':
12861 // capture original direction
12862 preAdjMeas = _it_msr->term1;
12863
12864 // "adjusted direction" is the original direction plus the
12865 // least squares estimated angle correction.
12866 adjMeas = _it_msr->term1 + correction;
12867
12868 // Don't print ignore flag for target directions
12869 break;
12870 default:
12871 // Print ignore flag if required
12872 if (_it_msr->ignore)
12873 ignoreFlag = "*";
12874 break;
12875 }
12876
12877 // Is this is longitude or elevation for GNSS?
12878 switch (cardinal)
12879 {
12880 case 'L': // GNSS (Y) Longitude
12881 case 'v': // GNSS (alt units) Elevation
12882 // Change from printing whitespace for 2nd/3rd baseline station components, to
12883 // printing all station information
12884 //adj_file << std::setw(PAD2+STATION+STATION+STATION) << " ";
12885
12886 // Measurement type
12887 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
12888 // first station
12889 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
12890 // second station
12891 switch (_it_msr->measType)
12892 {
12893 case 'G':
12894 case 'X':
12895 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
12896 break;
12897 case 'Y':
12898 adj_file << std::left << std::setw(STATION) << " ";
12899 }
12900 // third station
12901 adj_file << std::left << std::setw(STATION) << " ";
12902 }
12903
12904 adj_file << std::setw(PAD3) << std::left << ignoreFlag << std::setw(PAD2) << std::left << cardinal;
12905
12906 double precision(0.0);
12907
12908 // get the correct precision term
12909 switch (_it_msr->measType)
12910 {
12911 case 'G':
12912 case 'X':
12913 case 'Y':
12914 switch (cardinal)
12915 {
12916 case 'P':
12917 case 'a':
12918 precision = _it_msr->term2; // Precision (Meas)
12919 break;
12920 case 'L':
12921 case 'v':
12922 precision = _it_msr->term3; // Precision (Meas)
12923 break;
12924 }
12925 break;
12926 case 'D':
12927 // Precision of subtended angle derived from successive
12928 // direction set measurement precisions
12929 precision = _it_msr->scale2;
12930 break;
12931 default:
12932 precision = _it_msr->term2; // Precision (Meas)
12933 }
12934
12935 // Which angular format?
12936 if (projectSettings_.o._angular_type_msr == DMS)
12937 {
12938 switch (projectSettings_.o._dms_format_msr)
12939 {
12941 // ddd\B0 mm' ss.sss"
12942 adj_file <<
12943 std::setw(MSR) << std::right << FormatDmsString(RadtoDms(preAdjMeas), 4+PRECISION_SEC_MSR, // Measured (less correction
12944 true, true) << // for deflections if applied)
12945 std::setw(MSR) << std::right << FormatDmsString(RadtoDms(adjMeas), 4+PRECISION_SEC_MSR, // Adjusted
12946 true, true);
12947 break;
12948 case HP_NOTATION:
12949 // ddd.mmssssss
12950 adj_file << std::setw(MSR) << std::right << StringFromT(RadtoDms(preAdjMeas), 4+PRECISION_SEC_MSR) << // Measured (less correction for deflections)
12951 std::setw(MSR) << std::right << StringFromT(RadtoDms(adjMeas), 4+PRECISION_SEC_MSR); // Adjusted
12952 break;
12953 case SEPARATED:
12954 default:
12955 // ddd mm ss.ssss
12956 adj_file <<
12957 std::setw(MSR) << std::right << FormatDmsString(RadtoDms(preAdjMeas), 4+PRECISION_SEC_MSR, // Measured (less correction
12958 true, false) << // for deflections if applied)
12959 std::setw(MSR) << std::right << FormatDmsString(RadtoDms(adjMeas), 4+PRECISION_SEC_MSR, // Computed
12960 true, false);
12961 break;
12962 }
12963
12964 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
12965 adj_file <<
12966 std::right << StringFromTW(removeNegativeZero(Seconds(correction), PRECISION_SEC_MSR), CORR, PRECISION_SEC_MSR) << // correction
12967 std::right << StringFromTW(Seconds(sqrt(precision)), PREC, PRECISION_SEC_MSR); // Precision (Meas)
12968 else
12969 adj_file <<
12970 std::setw(CORR) << std::right << StringFromT(removeNegativeZero(Seconds(correction), PRECISION_SEC_MSR), PRECISION_SEC_MSR) << // correction
12971 std::setw(PREC) << std::right << StringFromT(Seconds(sqrt(precision)), PRECISION_SEC_MSR); // Precision (Meas)
12972
12973 if (printAdjMsr)
12974 {
12975 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
12976 adj_file <<
12977 std::right << StringFromTW(Seconds(sqrt(_it_msr->measAdjPrec)), PREC, PRECISION_SEC_MSR) << // Precision (Adjusted)
12978 std::right << StringFromTW(Seconds(sqrt(_it_msr->residualPrec)), PREC, PRECISION_SEC_MSR); // Precision (Residual)
12979 else
12980 adj_file <<
12981 std::setw(PREC) << std::right << StringFromT(Seconds(sqrt(_it_msr->measAdjPrec)), PRECISION_SEC_MSR) << // Precision (Adjusted)
12982 std::setw(PREC) << std::right << StringFromT(Seconds(sqrt(_it_msr->residualPrec)), PRECISION_SEC_MSR); // Precision (Residual)
12983 }
12984 }
12985 else // DDEG
12986 {
12987 // ddd.dddddddd
12988 //TODO - is longitude being printed? If so, use DegreesL
12989 adj_file << std::setw(MSR) << std::right << StringFromT(Degrees(preAdjMeas), 4+PRECISION_SEC_MSR) << // Measured (less correction for deflections)
12990 std::setw(MSR) << std::right << StringFromT(Degrees(adjMeas), 4+PRECISION_SEC_MSR); // Adjusted
12991
12992 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
12993 adj_file <<
12994 std::right << StringFromTW(removeNegativeZero(Degrees(correction), PRECISION_SEC_MSR), CORR, PRECISION_SEC_MSR) << // Correction
12995 std::right << StringFromTW(Degrees(sqrt(precision)), PREC, PRECISION_SEC_MSR); // Precision (Meas)
12996 else
12997 adj_file <<
12998 std::setw(CORR) << std::right << StringFromT(removeNegativeZero(Degrees(correction), PRECISION_SEC_MSR), PRECISION_SEC_MSR) << // Correction
12999 std::setw(PREC) << std::right << StringFromT(Degrees(sqrt(precision)), PRECISION_SEC_MSR); // Precision (Meas)
13000
13001 if (printAdjMsr)
13002 {
13003 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
13004 adj_file <<
13005 std::right << StringFromTW(Degrees(sqrt(_it_msr->measAdjPrec)), PREC, PRECISION_SEC_MSR) << // Precision (Adjusted)
13006 std::right << StringFromTW(Degrees(sqrt(_it_msr->residualPrec)), PREC, PRECISION_SEC_MSR); // Precision (Residual)
13007 else
13008 adj_file <<
13009 std::setw(PREC) << std::right << StringFromT(Degrees(sqrt(_it_msr->measAdjPrec)), PRECISION_SEC_MSR) << // Precision (Adjusted)
13010 std::setw(PREC) << std::right << StringFromT(Degrees(sqrt(_it_msr->residualPrec)), PRECISION_SEC_MSR); // Precision (Residual)
13011 }
13012 }
13013}
#define HP_NOTATION
Definition dnageoid.hpp:110
std::string StringFromTW(const T &t, const U &width, const U &precision=0)
T Degrees(T &radians)
T removeNegativeZero(const T &t, const U &precision)
@ SEPARATED_WITH_SYMBOLS
Definition dnatypes.hpp:354
@ SEPARATED
Definition dnatypes.hpp:353
@ DMS
Definition dnatypes.hpp:346

References adj_file, bstBinaryRecords_, CORR(), criticalValue_, Degrees(), DMS, FormatDmsString(), HP_NOTATION, isAdjustmentQuestionable_, MSR(), PAD2(), PAD3(), PREC(), PRECISION_SEC_MSR, projectSettings_, RadtoDms(), removeNegativeZero(), Seconds(), SEPARATED, SEPARATED_WITH_SYMBOLS, STATION(), StringFromT(), and StringFromTW().

Referenced by fillSinexExample(), PrintAdjMeasurementsAngular(), and PrintCompMeasurementsAngular().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintMeasurementsLinear()

void dynadjust::networkadjust::dna_adjust::PrintMeasurementsLinear ( const char cardinal,
const double & measurement,
const double & correction,
const it_vmsr_t & _it_msr,
bool printAdjMsr = true )
private

Definition at line 13036 of file dnaadjust.cpp.

13042{
13043 std::string ignoreFlag(" ");
13044 if (_it_msr->ignore)
13045 ignoreFlag = "*";
13046
13047 switch (cardinal)
13048 {
13049 case 'Y':
13050 case 'Z':
13051 case 'H':
13052 case 'n':
13053 case 'u':
13054 case 's':
13055 // Change from printing whitespace for 2nd/3rd baseline station components, to
13056 // printing all station information
13057 //adj_file << std::setw(PAD2+STATION+STATION+STATION) << " ";
13058
13059 // Measurement type
13060 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
13061 // first station
13062 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
13063 // second station
13064 switch (_it_msr->measType)
13065 {
13066 case 'G':
13067 case 'X':
13068 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
13069 break;
13070 case 'Y':
13071 adj_file << std::left << std::setw(STATION) << " ";
13072 }
13073 // third station
13074 adj_file << std::left << std::setw(STATION) << " ";
13075 }
13076
13077 adj_file << std::setw(PAD3) << std::left << ignoreFlag << std::setw(PAD2) << std::left << cardinal << // If GPS, then 'X', 'Y' or 'Z', else ' '
13078 std::setw(MSR) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << _it_msr->preAdjMeas << // Measured (less correction for geoid)
13079 std::setw(MSR) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << measurement; // Adjusted
13080
13081 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
13082 adj_file <<
13083 std::right << StringFromTW(removeNegativeZero(correction, PRECISION_MTR_MSR), CORR, PRECISION_MTR_MSR); // Correction
13084 else
13085 adj_file <<
13086 std::setw(CORR) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right <<
13087 removeNegativeZero(correction, PRECISION_MTR_MSR); // Correction
13088
13089 // print the correct precision term
13090 switch (_it_msr->measType)
13091 {
13092 case 'G':
13093 case 'X':
13094 case 'Y':
13095 switch (cardinal)
13096 {
13097 case 'X': // XYZ
13098 case 'e': // ENU
13099 adj_file << std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->term2); // Precision (Meas)
13100 break;
13101 case 'Y': // XYZ
13102 case 'n': // ENU
13103 adj_file << std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->term3); // Precision (Meas)
13104 break;
13105 case 'Z': // XYZ
13106 case 'u': // ENU
13107 case 'H': // LLH (Lat and Lon cardinals are printed in PrintMeasurementsAngular)
13108 adj_file << std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->term4); // Precision (Meas)
13109 break;
13110 case 's': // AED (Azimuth and vertical angle cardinals are printed in PrintMeasurementsAngular)
13111 switch (projectSettings_.o._adj_gnss_units)
13112 {
13113 case AED_adj_gnss_ui:
13114 adj_file << std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->term4); // Precision (Meas)
13115 break;
13116 case ADU_adj_gnss_ui:
13117 adj_file << std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->term3); // Precision (Meas)
13118 break;
13119 }
13120 break;
13121 }
13122 break;
13123 default:
13124 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
13125 adj_file << StringFromTW(sqrt(_it_msr->term2), PREC, PRECISION_MTR_MSR); // Precision (Meas)
13126 else
13127 adj_file << std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->term2); // Precision (Meas)
13128 }
13129
13130 if (printAdjMsr)
13131 {
13132 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
13133 adj_file <<
13134 std::right << StringFromTW(sqrt(_it_msr->measAdjPrec), PREC, PRECISION_MTR_MSR) << // Precision (Adjusted)
13135 std::right << StringFromTW(sqrt(_it_msr->residualPrec), PREC, PRECISION_MTR_MSR); // Precision (Residual)
13136 else
13137 adj_file << std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->measAdjPrec) << // Precision (Adjusted)
13138 std::setw(PREC) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << sqrt(_it_msr->residualPrec); // Precision (Residual)
13139 }
13140}
@ ADU_adj_gnss_ui
@ AED_adj_gnss_ui

References adj_file, ADU_adj_gnss_ui, AED_adj_gnss_ui, bstBinaryRecords_, CORR(), criticalValue_, isAdjustmentQuestionable_, MSR(), PAD2(), PAD3(), PREC(), PRECISION_MTR_MSR, projectSettings_, removeNegativeZero(), STATION(), and StringFromTW().

Referenced by fillSinexExample(), PrintAdjMeasurementsLinear(), and PrintCompMeasurementsLinear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintMeasurementCorrection()

void dynadjust::networkadjust::dna_adjust::PrintMeasurementCorrection ( const char cardinal,
const it_vmsr_t & _it_msr )
private

Definition at line 13142 of file dnaadjust.cpp.

13143{
13144 switch (_it_msr->measType)
13145 {
13146 case 'A':
13147 case 'B':
13148 case 'D':
13149 case 'I':
13150 case 'J':
13151 case 'K':
13152 case 'P':
13153 case 'Q':
13154 case 'V':
13155 case 'Z':
13156 // Pre adjustment correction for deflections
13157 adj_file << std::setw(PACORR) << std::setprecision(PRECISION_SEC_MSR) << std::fixed << std::right <<
13158 removeNegativeZero(Seconds(_it_msr->preAdjCorr), PRECISION_SEC_MSR);
13159 break;
13160 case 'Y':
13161 // Pre adjustment correction of N-value on GPS applies to H cardinal of Y clusters in
13162 // geographic format only!
13163 switch (cardinal)
13164 {
13165 case 'H':
13166 adj_file << std::setw(PACORR) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right <<
13167 removeNegativeZero(_it_msr->preAdjCorr, PRECISION_MTR_MSR);
13168 break;
13169 case 'P':
13170 case 'L':
13171 adj_file << std::setw(PACORR) << std::setprecision(PRECISION_SEC_MSR) << std::fixed << std::right << 0.0;
13172 break;
13173 default: // X, Y, Z
13174 adj_file << std::setw(PACORR) << std::setprecision(PRECISION_MTR_MSR) << std::fixed << std::right << 0.0;
13175 break;
13176 }
13177 break;
13178 case 'C':
13179 case 'E':
13180 case 'H':
13181 case 'L':
13182 case 'M':
13183 case 'S':
13184 case 'G':
13185 case 'X':
13186 default:
13187 // Pre adjustment correction for N-value or reductions from MSL/ellipsoid arcs
13188 adj_file << std::setw(PACORR) << std::setprecision(PRECISION_SEC_MSR) << std::fixed << std::right <<
13189 removeNegativeZero(_it_msr->preAdjCorr, PRECISION_SEC_MSR);
13190 break;
13191 }
13192
13193
13194}

References adj_file, PACORR(), PRECISION_MTR_MSR, PRECISION_SEC_MSR, removeNegativeZero(), and Seconds().

Referenced by fillSinexExample(), PrintAdjMeasurementStatistics(), PrintCompMeasurementsAngular(), and PrintCompMeasurementsLinear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintMeasurementDatabaseID()

void dynadjust::networkadjust::dna_adjust::PrintMeasurementDatabaseID ( const it_vmsr_t & _it_msr,
bool initialise_dbindex = true )
private

Definition at line 13196 of file dnaadjust.cpp.

13197{
13198 // set iterator to the database index
13199 if (initialise_dbindex)
13200 {
13201 size_t dbindx = std::distance(bmsBinaryRecords_.begin(), _it_msr);
13202 _it_dbid = v_msr_db_map_.begin() + dbindx;
13203 }
13204
13205 // Print measurement id
13206 if (_it_dbid->is_msr_id_set)
13207 adj_file << std::setw(STDDEV) << std::right << _it_dbid->msr_id;
13208 else
13209 adj_file << std::setw(STDDEV) << " ";
13210
13211 // Print cluster id?
13212 switch (_it_msr->measType)
13213 {
13214 case 'D':
13215 case 'G':
13216 case 'X':
13217 case 'Y':
13218 if (_it_dbid->is_cls_id_set)
13219 adj_file << std::setw(STDDEV) << std::right << _it_dbid->cluster_id;
13220 else
13221 adj_file << std::setw(STDDEV) << " ";
13222 }
13223}
const UINT16 STDDEV(10)

References _it_dbid, adj_file, bmsBinaryRecords_, STDDEV(), and v_msr_db_map_.

Referenced by fillSinexExample(), PrintAdjMeasurements_D(), PrintAdjMeasurementStatistics(), PrintCompMeasurements_D(), PrintCompMeasurementsAngular(), and PrintCompMeasurementsLinear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FormUniqueMsrList()

void dynadjust::networkadjust::dna_adjust::FormUniqueMsrList ( )
private

Definition at line 3113 of file dnaadjust.cpp.

3114{
3115 // Determine actual CML size
3116 size_t cml_size(0);
3117 for_each(v_CML_.begin(), v_CML_.end(),
3118 [&cml_size](vUINT32& blockCML){
3119 cml_size += blockCML.size();
3120 });
3121
3122 UINT32 block(0);
3123 it_vvUINT32 _it_cml;
3124 it_vUINT32 _it_block_msr;
3125
3126 v_msr_block_.clear();
3127 v_msr_block_.reserve(cml_size);
3128
3129 // Fill vector of msr-block pairs
3130 for (_it_cml=v_CML_.begin(); _it_cml!=v_CML_.end(); ++_it_cml, ++block)
3131 for (_it_block_msr=_it_cml->begin(); _it_block_msr!=_it_cml->end(); ++_it_block_msr)
3132 v_msr_block_.push_back(
3133 uint32_u32u32_pair(*_it_block_msr, // msr index
3134 uint32_uint32_pair(block, 0))); // block, precision adj msr row
3135
3136 // Is the index to the first row of the precision of adjusted measurements vector needed?
3137 if (projectSettings_.o._adj_gnss_units == XYZ_adj_gnss_ui)
3138 return;
3139
3140 it_vmsr_t _it_msr;
3141 _it_uint32_u32u32_pair _it_b_pam;
3142 UINT32 precadjmsr_row(0);
3143 block = UINT_MAX;
3144
3145 for (_it_b_pam=v_msr_block_.begin(); _it_b_pam!=v_msr_block_.end(); ++_it_b_pam)
3146 {
3147 // new block? Initialise row counter to the first row
3148 if (block != _it_b_pam->second.first)
3149 {
3150 precadjmsr_row = 0;
3151 block = _it_b_pam->second.first;
3152 }
3153
3154 // Set index
3155 _it_b_pam->second.second = precadjmsr_row;
3156
3157 // Get the next measurement and determine how many rows until the next index
3158 _it_msr = bmsBinaryRecords_.begin() + (_it_b_pam->first);
3159
3160 switch (_it_msr->measType)
3161 {
3162 // Single row measurements
3163 case 'A':
3164 case 'B': // Geodetic azimuth
3165 case 'C': // Chord dist
3166 case 'E': // Ellipsoid arc
3167 case 'K': // Astronomic azimuth
3168 case 'L': // Level difference
3169 case 'M': // MSL arc
3170 case 'S': // Slope distance
3171 case 'V': // Zenith distance
3172 case 'Z': // Vertical angle
3173 case 'H': // Orthometric height
3174 case 'I': // Astronomic latitude
3175 case 'J': // Astronomic longitude
3176 case 'P': // Geodetic latitude
3177 case 'Q': // Geodetic longitude
3178 case 'R': // Ellipsoidal height
3179 precadjmsr_row++;
3180 break;
3181 // Single row per subtended angle (# directions less 1)
3182 case 'D': // Direction set
3183 precadjmsr_row += (_it_msr->vectorCount2 - 1);
3184 break;
3185 // Three rows (6 elements for upper triangular)
3186 case 'G': // GPS Baseline
3187 precadjmsr_row += 6;
3188 break;
3189 // Three rows (6 elements for upper triangular) per
3190 // cluster measurement
3191 case 'X': // GPS Baseline cluster
3192 case 'Y': // GPS Point cluster
3193 precadjmsr_row += _it_msr->vectorCount1 * 6;
3194 break;
3195 }
3196
3197 }
3198
3199}
@ XYZ_adj_gnss_ui
std::pair< UINT32, uint32_uint32_pair > uint32_u32u32_pair
Definition dnatypes.hpp:113
vvUINT32::iterator it_vvUINT32
Definition dnatypes.hpp:101
std::pair< UINT32, UINT32 > uint32_uint32_pair
Definition dnatypes.hpp:105

References bmsBinaryRecords_, projectSettings_, v_CML_, v_msr_block_, and XYZ_adj_gnss_ui.

Referenced by fillSinexExample(), and PrepareAdjustment().

Here is the caller graph for this function:

◆ PrintAdjMeasurementsHeader()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurementsHeader ( bool printHeader,
const std::string & table_heading,
printMeasurementsMode printMode,
UINT32 block,
bool printBlocks = false )
private

Definition at line 10629 of file dnaadjust.cpp.

10631{
10632 if (printHeader)
10633 adj_file << std::endl << table_heading << std::endl <<
10634 "------------------------------------------" << std::endl << std::endl;
10635
10636 if (printBlocks)
10637 {
10638 switch (projectSettings_.a.adjust_mode)
10639 {
10640 case PhasedMode:
10641 case Phased_Block_1Mode:
10642 if (projectSettings_.o._output_msr_blocks)
10643 adj_file << "Block " << block << std::endl;
10644 break;
10645 }
10646 }
10647
10648 std::string col1_heading, col2_heading;
10649
10650 // determine headings
10651 switch (printMode)
10652 {
10653 case ignoredMsrs:
10654 case computedMsrs:
10655 col1_heading = "Computed";
10656 col2_heading = "Difference";
10657 break;
10658 case adjustedMsrs:
10659 col1_heading = "Adjusted";
10660 col2_heading = "Correction";
10661 break;
10662 }
10663
10664 // print header
10665
10666 // Adjusted, computed and ignored measurements
10668 adj_file <<
10669 std::setw(PAD2) << std::left << "M" <<
10670 std::setw(STATION) << std::left << "Station 1" <<
10671 std::setw(STATION) << std::left << "Station 2" <<
10672 std::setw(STATION) << std::left << "Station 3";
10673
10674 // Adjusted, computed and ignored measurements
10675 j += PAD3 + PAD3 + MSR + MSR + CORR + PREC;
10676 adj_file <<
10677 std::setw(PAD3) << std::left << "*" <<
10678 std::setw(PAD2) << std::left << "C" <<
10679 std::setw(MSR) << std::right << "Measured" <<
10680 std::setw(MSR) << std::right << col1_heading << // Computed or Adjusted
10681 std::setw(CORR) << std::right << col2_heading << // Difference or Correction
10682 std::setw(PREC) << std::right << "Meas. SD";
10683
10684 // Adjusted measurements only
10685 switch (printMode)
10686 {
10687 case adjustedMsrs:
10688 j += PREC + PREC + STAT;
10689 adj_file <<
10690 std::setw(PREC) << std::right << "Adj. SD" <<
10691 std::setw(PREC) << std::right << "Corr. SD" <<
10692 std::setw(STAT) << std::right << "N-stat";
10693
10694 // print t-statistics?
10695 if (projectSettings_.o._adj_msr_tstat)
10696 {
10697 j += STAT;
10698 adj_file << std::setw(STAT) << std::right << "T-stat";
10699 }
10700
10701 j += REL;
10702 adj_file <<
10703 std::setw(REL) << std::right << "Pelzer Rel";
10704 break;
10705 default:
10706 break;
10707 }
10708
10709 // Adjusted, computed and ignored measurements
10710 j += PACORR;
10711 adj_file <<
10712 std::setw(PACORR) << std::right << "Pre Adj Corr";
10713
10714 // Adjusted measurements only
10715 switch (printMode)
10716 {
10717 case adjustedMsrs:
10718 j += OUTLIER;
10719 adj_file <<
10720 std::setw(OUTLIER) << std::right << "Outlier?";
10721 break;
10722 default:
10723 break;
10724 }
10725
10726 // Adjusted, computed and ignored measurements
10727 // Print database ids?
10728 if (projectSettings_.o._database_ids)
10729 {
10730 j += STDDEV + STDDEV;
10731 adj_file <<
10732 std::setw(STDDEV) << std::right << "Meas. ID" <<
10733 std::setw(STDDEV) << std::right << "Clust. ID";
10734 }
10735
10736 adj_file << std::endl;
10737
10738 UINT32 i;
10739 for (i=0; i<j; ++i)
10740 adj_file << "-";
10741
10742 adj_file << std::endl;
10743}
const UINT16 OUTLIER(12)
const UINT16 REL(12)
const UINT16 STAT(11)
@ adjustedMsrs

References adj_file, adjustedMsrs, computedMsrs, CORR(), ignoredMsrs, MSR(), OUTLIER(), PACORR(), PAD2(), PAD3(), Phased_Block_1Mode, PhasedMode, PREC(), projectSettings_, REL(), STAT(), STATION(), and STDDEV().

Referenced by fillSinexExample(), PrintAdjMeasurements(), PrintCompMeasurements(), and PrintIgnoredAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements ( v_uint32_u32u32_pair msr_block,
bool printHeader )
private

Definition at line 12226 of file dnaadjust.cpp.

12227{
12228 // Print heading
12229 std::string table_heading("Adjusted Measurements");
12230
12231 if (projectSettings_.o._adj_msr_iteration)
12232 {
12233 std::stringstream ss;
12234 if (projectSettings_.a.adjust_mode == PhasedMode && forward_)
12235 {
12236 UINT32 block = msr_block.at(0).second.first;
12237 ss << " (Block " << msr_block.at(0).second.first + 1 << ", ";
12238 if (v_blockMeta_.at(block)._blockLast || v_blockMeta_.at(block)._blockIsolated)
12239 ss << "rigorous)";
12240 else
12241 ss << "in isolation)";
12242 table_heading.append(ss.str());
12243 }
12244 else if (projectSettings_.a.adjust_mode == PhasedMode && isIterationComplete_)
12245 {
12246 ss << " (Iteration " << CurrentIteration() << ")";
12247 table_heading.append(ss.str());
12248 }
12249 }
12250
12251 PrintAdjMeasurementsHeader(printHeader, table_heading,
12252 adjustedMsrs, msr_block.at(0).second.first + 1, true);
12253
12254 _it_uint32_u32u32_pair _it_block_msr;
12255 it_vmsr_t _it_msr;
12256
12257 try {
12258 // Should the adjusted measurements be sorted?
12259 switch (projectSettings_.o._sort_adj_msr)
12260 {
12262 SortMeasurementsbyType(msr_block);
12263 break;
12265 SortMeasurementsbyToStn(msr_block);
12266 break;
12268 SortMeasurementsbyFromStn(msr_block);
12269 break;
12271 SortMeasurementsbyValue(msr_block);
12272 break;
12274 SortMeasurementsbyResidual(msr_block);
12275 break;
12277 SortMeasurementsbyAdjSD(msr_block);
12278 break;
12280 SortMeasurementsbyNstat(msr_block);
12281 break;
12283 default:
12284 std::sort(msr_block.begin(), msr_block.end());
12285 break;
12286 }
12287 }
12288 catch (...) {
12289 std::stringstream ss;
12290 ss << "Failed to sort measurements according to the ";
12291
12292 switch (projectSettings_.o._sort_adj_msr)
12293 {
12295 ss << "original file order";
12296 break;
12298 ss << "measurement type";
12299 break;
12301 ss << "first measurement station";
12302 break;
12304 ss << "second measurement station";
12305 break;
12307 ss << "measurement value";
12308 break;
12310 ss << "measurement correction";
12311 break;
12313 ss << "adjusted measurement standard deviation";
12314 break;
12316 ss << "measurement n-statistic";
12317 break;
12318 }
12319
12320
12321 ss << std::endl;
12322 SignalExceptionAdjustment(ss.str(), 0);
12323 }
12324
12325 UINT32 clusterID(MAX_UINT32_VALUE);
12326
12327 for (_it_block_msr=msr_block.begin(); _it_block_msr!=msr_block.end(); ++_it_block_msr)
12328 {
12329 _it_msr = bmsBinaryRecords_.begin() + (_it_block_msr->first);
12330
12331 // When a non-measurement element is found (i.e. Y or Z or covariance component),
12332 // continue to next element. Hence, only pointers to the starting element of each
12333 // measurement are kept. See declaration of measRecord.measStart for more info.
12334 if (_it_msr->measStart != xMeas)
12335 continue;
12336
12337 // When a target direction is found, continue to next element.
12338 if (_it_msr->measType == 'D')
12339 if (_it_msr->vectorCount1 < 1)
12340 continue;
12341
12342 // For cluster measurements, only print measurement type if
12343 // this measurement is from a new cluster
12344 switch (_it_msr->measType)
12345 {
12346 case 'D': // Direction set
12347 case 'X': // GPS Baseline cluster
12348 case 'Y': // GPS Point cluster
12349 if (_it_msr->clusterID != clusterID)
12350 {
12351 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
12352 clusterID = _it_msr->clusterID;
12353 }
12354 else
12355 adj_file << " ";
12356 break;
12357 default:
12358 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
12359 }
12360
12361 // normal format
12362 switch (_it_msr->measType)
12363 {
12364 case 'A': // Horizontal angle
12365 PrintAdjMeasurements_A(_it_msr);
12366 break;
12367 case 'B': // Geodetic azimuth
12368 case 'K': // Astronomic azimuth
12369 case 'V': // Zenith distance
12370 case 'Z': // Vertical angle
12372 break;
12373 case 'C': // Chord dist
12374 case 'E': // Ellipsoid arc
12375 case 'L': // Level difference
12376 case 'M': // MSL arc
12377 case 'S': // Slope distance
12379 break;
12380 case 'D': // Direction set
12381 PrintAdjMeasurements_D(_it_msr);
12382 break;
12383 case 'H': // Orthometric height
12384 case 'R': // Ellipsoidal height
12385 PrintAdjMeasurements_HR(_it_msr);
12386 break;
12387 case 'I': // Astronomic latitude
12388 case 'J': // Astronomic longitude
12389 case 'P': // Geodetic latitude
12390 case 'Q': // Geodetic longitude
12392 break;
12393 case 'G': // GPS Baseline (treat as single-baseline cluster)
12394 case 'X': // GPS Baseline cluster
12395 case 'Y': // GPS Point cluster
12396 PrintAdjMeasurements_GXY(_it_msr, _it_block_msr->second);
12397 break;
12398 }
12399
12400 }
12401
12402 adj_file << std::endl;
12403}
void SortMeasurementsbyNstat(v_uint32_u32u32_pair &msr_block)
void PrintAdjMeasurements_D(it_vmsr_t &_it_msr)
void SortMeasurementsbyType(v_uint32_u32u32_pair &msr_block)
void SortMeasurementsbyValue(v_uint32_u32u32_pair &msr_block)
void PrintAdjMeasurements_HR(it_vmsr_t &_it_msr)
void SortMeasurementsbyFromStn(v_uint32_u32u32_pair &msr_block)
void PrintAdjMeasurements_A(it_vmsr_t &_it_msr)
void PrintAdjMeasurements_IJPQ(it_vmsr_t &_it_msr)
void PrintAdjMeasurements_CELMS(it_vmsr_t &_it_msr)
void SortMeasurementsbyResidual(v_uint32_u32u32_pair &msr_block)
void SortMeasurementsbyToStn(v_uint32_u32u32_pair &msr_block)
void SortMeasurementsbyAdjSD(v_uint32_u32u32_pair &msr_block)
void PrintAdjMeasurements_GXY(it_vmsr_t &_it_msr, const uint32_uint32_pair &b_pam)
void PrintAdjMeasurements_BKVZ(it_vmsr_t &_it_msr)
const UINT32 MAX_UINT32_VALUE(0xffffffff)
@ a_sd_adj_msr_sort_ui
@ orig_adj_msr_sort_ui
@ corr_adj_msr_sort_ui
@ targ_adj_msr_sort_ui
@ inst_adj_msr_sort_ui
@ type_adj_msr_sort_ui
@ n_st_adj_msr_sort_ui
@ meas_adj_msr_sort_ui

References a_sd_adj_msr_sort_ui, adj_file, adjustedMsrs, bmsBinaryRecords_, corr_adj_msr_sort_ui, CurrentIteration(), forward_, inst_adj_msr_sort_ui, isIterationComplete_, MAX_UINT32_VALUE(), meas_adj_msr_sort_ui, n_st_adj_msr_sort_ui, orig_adj_msr_sort_ui, PAD2(), PhasedMode, PrintAdjMeasurements_A(), PrintAdjMeasurements_BKVZ(), PrintAdjMeasurements_CELMS(), PrintAdjMeasurements_D(), PrintAdjMeasurements_GXY(), PrintAdjMeasurements_HR(), PrintAdjMeasurements_IJPQ(), PrintAdjMeasurementsHeader(), projectSettings_, SignalExceptionAdjustment(), SortMeasurementsbyAdjSD(), SortMeasurementsbyFromStn(), SortMeasurementsbyNstat(), SortMeasurementsbyResidual(), SortMeasurementsbyToStn(), SortMeasurementsbyType(), SortMeasurementsbyValue(), targ_adj_msr_sort_ui, type_adj_msr_sort_ui, v_blockMeta_, and xMeas.

Referenced by ComputeandPrintAdjMsrBlockOnIteration(), fillSinexExample(), and PrintAdjustedNetworkMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurementsAngular()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurementsAngular ( const char cardinal,
const it_vmsr_t & _it_msr,
bool initialise_dbindex = true )
private

Definition at line 13016 of file dnaadjust.cpp.

13017{
13018 // Print adjusted angular measurements
13019 PrintMeasurementsAngular(cardinal, _it_msr->measAdj, _it_msr->measCorr, _it_msr);
13020
13021 // Print adjusted statistics
13022 PrintAdjMeasurementStatistics(cardinal, _it_msr, initialise_dbindex);
13023}
void PrintAdjMeasurementStatistics(const char cardinal, const it_vmsr_t &_it_msr, bool initialise_dbindex=true)

References PrintAdjMeasurementStatistics(), and PrintMeasurementsAngular().

Referenced by fillSinexExample(), PrintAdjGNSSAlternateUnits(), PrintAdjMeasurements_A(), PrintAdjMeasurements_BKVZ(), PrintAdjMeasurements_D(), PrintAdjMeasurements_IJPQ(), and PrintAdjMeasurements_YLLH().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurementsLinear()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurementsLinear ( const char cardinal,
const it_vmsr_t & _it_msr,
bool initialise_dbindex = true )
private

Definition at line 13026 of file dnaadjust.cpp.

13027{
13028 // Print adjusted linear measurements
13029 PrintMeasurementsLinear(cardinal, _it_msr->measAdj, _it_msr->measCorr, _it_msr);
13030
13031 // Print adjusted statistics
13032 PrintAdjMeasurementStatistics(cardinal, _it_msr, initialise_dbindex);
13033}

References PrintAdjMeasurementStatistics(), and PrintMeasurementsLinear().

Referenced by fillSinexExample(), PrintAdjGNSSAlternateUnits(), PrintAdjMeasurements_CELMS(), PrintAdjMeasurements_GXY(), PrintAdjMeasurements_HR(), and PrintAdjMeasurements_YLLH().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjGNSSAlternateUnits()

void dynadjust::networkadjust::dna_adjust::PrintAdjGNSSAlternateUnits ( it_vmsr_t & _it_msr,
const uint32_uint32_pair & b_pam )
private

Definition at line 13656 of file dnaadjust.cpp.

13657{
13658 // Create copy of _it_msr, transform, then send to PrintAdjMeasurementsLinear
13659 vmsr_t gnss_msr;
13660 // vector components (original and adjusted)
13661 matrix_2d gnss_cart(3, 1), gnss_local(3, 1);
13662 matrix_2d gnss_adj_cart(3, 1), gnss_adj_local(3, 1);
13663 // variance components (original and adjusted)
13664 matrix_2d var_cart(3, 3), var_local(3, 3), var_polar(3, 3);
13665 matrix_2d var_adj_local(3, 3), var_adj_polar(3, 3);
13666
13667 // For staged adjustments, load precision of adjusted measurements
13668 if (projectSettings_.a.stage)
13670
13671 // get precision of adjusted measurements
13672 double lower_mtx_buffer[6];
13673 memcpy(lower_mtx_buffer, v_precAdjMsrsFull_.at(b_pam.first).getbuffer(b_pam.second, 0), sizeof(lower_mtx_buffer));
13674 matrix_2d var_adj_cart(3, 3, lower_mtx_buffer, 6, mtx_lower);
13675 var_adj_cart.fillupper();
13676
13677 if (projectSettings_.a.stage)
13678 // For staged adjustments, unload precision of adjusted measurements
13679 UnloadBlock(b_pam.first, 1, sf_prec_adj_msrs);
13680
13681 // Get X
13682 gnss_msr.push_back(*_it_msr);
13683 gnss_cart.put(0, 0, _it_msr->term1);
13684 gnss_adj_cart.put(0, 0, _it_msr->measAdj);
13685
13686 var_cart.put(0, 0, _it_msr->term2);
13687
13688 // Get Y
13689 _it_msr++;
13690 gnss_msr.push_back(*_it_msr);
13691 gnss_cart.put(1, 0, _it_msr->term1);
13692 gnss_adj_cart.put(1, 0, _it_msr->measAdj);
13693
13694 var_cart.put(0, 1, _it_msr->term2);
13695 var_cart.put(1, 1, _it_msr->term3);
13696
13697 // Get Z
13698 _it_msr++;
13699 gnss_msr.push_back(*_it_msr);
13700 gnss_cart.put(2, 0, _it_msr->term1);
13701 gnss_adj_cart.put(2, 0, _it_msr->measAdj);
13702
13703 var_cart.put(0, 2, _it_msr->term2);
13704 var_cart.put(1, 2, _it_msr->term3);
13705 var_cart.put(2, 2, _it_msr->term4);
13706
13707 it_vmsr_t _it_gnss_msr(gnss_msr.begin());
13708
13709 var_cart.filllower();
13710
13711 double azimuth, elevation, distance;
13712 double azimuthAdj, elevationAdj, distanceAdj;
13713 double mid_lat(average(
13714 bstBinaryRecords_.at(_it_msr->station1).currentLatitude,
13715 bstBinaryRecords_.at(_it_msr->station2).currentLatitude));
13716 double mid_long(average(
13717 bstBinaryRecords_.at(_it_msr->station1).currentLongitude,
13718 bstBinaryRecords_.at(_it_msr->station2).currentLongitude));
13719
13720 matrix_2d rotations;
13721
13722 Rotate_CartLocal<double>(gnss_cart, &gnss_local,
13723 bstBinaryRecords_.at(_it_msr->station1).currentLatitude,
13724 bstBinaryRecords_.at(_it_msr->station1).currentLongitude);
13725 Rotate_CartLocal<double>(gnss_adj_cart, &gnss_adj_local,
13726 bstBinaryRecords_.at(_it_msr->station1).currentLatitude,
13727 bstBinaryRecords_.at(_it_msr->station1).currentLongitude);
13728
13729 // return iterator to the X component of the GNSS measurement
13730 _it_msr -= 2;
13731
13732 switch (projectSettings_.o._adj_gnss_units)
13733 {
13734 case ENU_adj_gnss_ui:
13735
13736 // term2: e
13737 // term3: n
13738 // term4: u
13739
13740 // Propagate Variances from cartesian to local system - diagonals only
13742 mid_lat, mid_long,
13743 rotations, true);
13744 PropagateVariances_CartLocal_Diagonal<double>(var_adj_cart, var_adj_local,
13745 mid_lat, mid_long,
13746 rotations, false);
13747
13748 // E
13749 _it_gnss_msr->preAdjMeas = gnss_local.get(0, 0);
13750 _it_gnss_msr->measAdj = gnss_adj_local.get(0, 0);
13751 _it_gnss_msr->measCorr = gnss_adj_local.get(0, 0) - gnss_local.get(0, 0);
13752
13753 _it_gnss_msr->term2 = var_local.get(0, 0);
13754 _it_gnss_msr->measAdjPrec = var_adj_local.get(0, 0);
13755 _it_gnss_msr->residualPrec = _it_gnss_msr->term2 - _it_gnss_msr->measAdjPrec;
13756
13757 // Update Pelzer reliability, N-Stat, T-Stat
13758 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term2);
13759
13760 // Initialise database id iterator
13761 if (projectSettings_.o._database_ids)
13762 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13763
13764 PrintAdjMeasurementsLinear('e', _it_gnss_msr, false);
13765
13766 // N
13767 _it_msr++;
13768 _it_gnss_msr++;
13769 _it_gnss_msr->preAdjMeas = gnss_local.get(1, 0);
13770 _it_gnss_msr->measAdj = gnss_adj_local.get(1, 0);
13771 _it_gnss_msr->measCorr = gnss_adj_local.get(1, 0) - gnss_local.get(1, 0);
13772
13773 _it_gnss_msr->term3 = var_local.get(1, 1);
13774 _it_gnss_msr->measAdjPrec = var_adj_local.get(1, 1);
13775 _it_gnss_msr->residualPrec = _it_gnss_msr->term3 - _it_gnss_msr->measAdjPrec;
13776
13777 // Update Pelzer reliability, N-Stat, T-Stat
13778 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term3);
13779
13780 // Initialise database id iterator
13781 if (projectSettings_.o._database_ids)
13782 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13783
13784 PrintAdjMeasurementsLinear('n', _it_gnss_msr, false);
13785
13786 // U
13787 _it_msr++;
13788 _it_gnss_msr++;
13789 _it_gnss_msr->preAdjMeas = gnss_local.get(2, 0);
13790 _it_gnss_msr->measAdj = gnss_adj_local.get(2, 0);
13791 _it_gnss_msr->measCorr = gnss_adj_local.get(2, 0) - gnss_local.get(2, 0);
13792
13793 _it_gnss_msr->term4 = var_local.get(2, 2);
13794 _it_gnss_msr->measAdjPrec = var_adj_local.get(2, 2);
13795 _it_gnss_msr->residualPrec = _it_gnss_msr->term4 - _it_gnss_msr->measAdjPrec;
13796
13797 // Update Pelzer reliability, N-Stat, T-Stat
13798 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term4);
13799
13800 // Initialise database id iterator
13801 if (projectSettings_.o._database_ids)
13802 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13803
13804 PrintAdjMeasurementsLinear('u', _it_gnss_msr, false);
13805 break;
13806 case AED_adj_gnss_ui:
13807
13808 // term2: a
13809 // term3: e
13810 // term4: s
13811
13812 azimuth = Direction(gnss_local.get(0, 0), gnss_local.get(1, 0));
13813 elevation = VerticalAngle(gnss_local.get(0, 0), gnss_local.get(1, 0), gnss_local.get(2, 0));
13814 distance = magnitude(gnss_local.get(0, 0), gnss_local.get(1, 0), gnss_local.get(2, 0));
13815
13816 azimuthAdj = Direction(gnss_adj_local.get(0, 0), gnss_adj_local.get(1, 0));
13817 elevationAdj = VerticalAngle(gnss_adj_local.get(0, 0), gnss_adj_local.get(1, 0), gnss_adj_local.get(2, 0));
13818 distanceAdj = magnitude(gnss_adj_local.get(0, 0), gnss_adj_local.get(1, 0), gnss_adj_local.get(2, 0));
13819
13820 // Propagate Variances from cartesian to local system - full matrix (for local-polar)
13821 PropagateVariances_LocalCart<double>(var_cart, var_local,
13822 mid_lat, mid_long, false,
13823 rotations, true);
13824 PropagateVariances_LocalCart<double>(var_adj_cart, var_adj_local,
13825 mid_lat, mid_long, false,
13826 rotations, false);
13827
13828 // Propagate variance matrices from local reference frame to
13829 // polar (azimuth, elevation angle and distance)
13831 azimuth, elevation, distance,
13832 rotations, true);
13833 PropagateVariances_LocalPolar_Diagonal<double>(var_adj_local, var_adj_polar,
13834 azimuth, elevation, distance,
13835 rotations, false);
13836
13837 // Print Geodetic azimuth
13838 _it_gnss_msr->preAdjMeas = azimuth;
13839 _it_gnss_msr->measAdj = azimuthAdj;
13840 _it_gnss_msr->measCorr = azimuthAdj - azimuth;
13841
13842 _it_gnss_msr->term2 = var_polar.get(0, 0);
13843 _it_gnss_msr->measAdjPrec = var_adj_polar.get(0, 0);
13844 _it_gnss_msr->residualPrec = _it_gnss_msr->term2 - _it_gnss_msr->measAdjPrec;
13845
13846 // Update Pelzer reliability, N-Stat, T-Stat
13847 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term2);
13848
13849 // Initialise database id iterator
13850 if (projectSettings_.o._database_ids)
13851 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13852
13853 PrintAdjMeasurementsAngular('a', _it_gnss_msr, false);
13854
13855 // Print vertical angle
13856 _it_msr++;
13857 _it_gnss_msr++;
13858 _it_gnss_msr->preAdjMeas = elevation;
13859 _it_gnss_msr->measAdj = elevationAdj;
13860 _it_gnss_msr->measCorr = elevationAdj - elevation;
13861
13862 _it_gnss_msr->term3 = var_polar.get(1, 1);
13863 _it_gnss_msr->measAdjPrec = var_adj_polar.get(1, 1);
13864 _it_gnss_msr->residualPrec = _it_gnss_msr->term3 - _it_gnss_msr->measAdjPrec;
13865
13866 // Update Pelzer reliability, N-Stat, T-Stat
13867 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term3);
13868
13869 // Initialise database id iterator
13870 if (projectSettings_.o._database_ids)
13871 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13872
13873 PrintAdjMeasurementsAngular('v', _it_gnss_msr, false);
13874
13875 // Print slope distance
13876 _it_msr++;
13877 _it_gnss_msr++;
13878 _it_gnss_msr->preAdjMeas = distance;
13879 _it_gnss_msr->measAdj = distanceAdj;
13880 _it_gnss_msr->measCorr = distanceAdj - distance;
13881
13882 //var_polar.trace("var_polar", "%.16g ");
13883
13884 _it_gnss_msr->term4 = var_polar.get(2, 2);
13885 _it_gnss_msr->measAdjPrec = var_adj_polar.get(2, 2);
13886 _it_gnss_msr->residualPrec = _it_gnss_msr->term4 - _it_gnss_msr->measAdjPrec;
13887
13888 // Update Pelzer reliability, N-Stat, T-Stat
13889 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term4);
13890
13891 // Initialise database id iterator
13892 if (projectSettings_.o._database_ids)
13893 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13894
13895 PrintAdjMeasurementsLinear('s', _it_gnss_msr, false);
13896 break;
13897 case ADU_adj_gnss_ui:
13898
13899 // term2: a
13900 // term3: s
13901 // term4: u
13902
13903 azimuth = Direction(gnss_local.get(0, 0), gnss_local.get(1, 0));
13904 elevation = VerticalAngle(gnss_local.get(0, 0), gnss_local.get(1, 0), gnss_local.get(2, 0));
13905 distance = magnitude(gnss_local.get(0, 0), gnss_local.get(1, 0), gnss_local.get(2, 0));
13906
13907 azimuthAdj = Direction(gnss_adj_local.get(0, 0), gnss_adj_local.get(1, 0));
13908 distanceAdj = magnitude(gnss_adj_local.get(0, 0), gnss_adj_local.get(1, 0), gnss_adj_local.get(2, 0));
13909
13910 // Propagate Variances from cartesian to local system - full matrix (for local-polar)
13911 PropagateVariances_LocalCart<double>(var_cart, var_local,
13912 mid_lat, mid_long, false,
13913 rotations, true);
13914 PropagateVariances_LocalCart<double>(var_adj_cart, var_adj_local,
13915 mid_lat, mid_long, false,
13916 rotations, false);
13917
13918 // Propagate variance matrices from local reference frame to
13919 // polar (azimuth, distance and up)
13921 azimuth, elevation, distance,
13922 rotations, true);
13923 PropagateVariances_LocalPolar_Diagonal<double>(var_adj_local, var_adj_polar,
13924 azimuth, elevation, distance,
13925 rotations, false);
13926
13927 // Print A
13928 _it_gnss_msr->preAdjMeas = azimuth;
13929 _it_gnss_msr->measAdj = azimuthAdj;
13930 _it_gnss_msr->measCorr = azimuthAdj - azimuth;
13931
13932 _it_gnss_msr->term2 = var_polar.get(0, 0);
13933 _it_gnss_msr->measAdjPrec = var_adj_polar.get(0, 0);
13934 _it_gnss_msr->residualPrec = _it_gnss_msr->term2 - _it_gnss_msr->measAdjPrec;
13935
13936 // Update Pelzer reliability, N-Stat, T-Stat
13937 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term2);
13938
13939 // Initialise database id iterator
13940 if (projectSettings_.o._database_ids)
13941 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13942
13943 PrintAdjMeasurementsAngular('a', _it_gnss_msr, false);
13944
13945 // Print slope distance
13946 _it_msr++;
13947 _it_gnss_msr++;
13948 _it_gnss_msr->preAdjMeas = distance;
13949 _it_gnss_msr->measAdj = distanceAdj;
13950 _it_gnss_msr->measCorr = distanceAdj - distance;
13951
13952 //var_polar.trace("var_polar", "%.16g ");
13953
13954 _it_gnss_msr->term3 = var_polar.get(2, 2);
13955 _it_gnss_msr->measAdjPrec = var_adj_polar.get(2, 2);
13956 _it_gnss_msr->residualPrec = _it_gnss_msr->term3 - _it_gnss_msr->measAdjPrec;
13957
13958 // Update Pelzer reliability, N-Stat, T-Stat
13959 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term3);
13960
13961 // Initialise database id iterator
13962 if (projectSettings_.o._database_ids)
13963 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13964
13965 PrintAdjMeasurementsLinear('s', _it_gnss_msr, false);
13966
13967 // Print up
13968 _it_msr++;
13969 _it_gnss_msr++;
13970 _it_gnss_msr->preAdjMeas = gnss_local.get(2, 0);
13971 _it_gnss_msr->measAdj = gnss_adj_local.get(2, 0);
13972 _it_gnss_msr->measCorr = gnss_adj_local.get(2, 0) - gnss_local.get(2, 0);
13973
13974 _it_gnss_msr->term4 = var_local.get(2, 2);
13975 _it_gnss_msr->measAdjPrec = var_adj_local.get(2, 2);
13976 _it_gnss_msr->residualPrec = _it_gnss_msr->term4 - _it_gnss_msr->measAdjPrec;
13977
13978 // Update Pelzer reliability, N-Stat, T-Stat
13979 UpdateMsrRecordStats(_it_gnss_msr, _it_gnss_msr->term4);
13980
13981 // Initialise database id iterator
13982 if (projectSettings_.o._database_ids)
13983 _it_dbid = v_msr_db_map_.begin() + std::distance(bmsBinaryRecords_.begin(), _it_msr);
13984
13985 PrintAdjMeasurementsLinear('u', _it_gnss_msr, false);
13986 break;
13987 }
13988}
void PrintAdjMeasurementsLinear(const char cardinal, const it_vmsr_t &_it_msr, bool initialise_dbindex=true)
void PrintAdjMeasurementsAngular(const char cardinal, const it_vmsr_t &_it_msr, bool initialise_dbindex=true)
T average(const iterator begin, const iterator end, U &sum)
void PropagateVariances_LocalPolar_Diagonal(const matrix_2d &mvariances, matrix_2d &mvariances_mod, const T &azimuth, const T &elevation, const T &distance, matrix_2d &mrotations, bool CALCULATE_ROTATIONS=false)
void PropagateVariances_CartLocal_Diagonal(const matrix_2d &mvariances, matrix_2d &mvariances_mod, const T &latitude, const T &longitude, matrix_2d &mrotations, bool CALCULATE_ROTATIONS=false)
@ ENU_adj_gnss_ui

References _it_dbid, ADU_adj_gnss_ui, AED_adj_gnss_ui, average(), bmsBinaryRecords_, bstBinaryRecords_, DeserialiseBlockFromMappedFile(), Direction(), ENU_adj_gnss_ui, dynadjust::math::matrix_2d::fillupper(), dynadjust::math::matrix_2d::get(), magnitude(), mtx_lower, PrintAdjMeasurementsAngular(), PrintAdjMeasurementsLinear(), projectSettings_, PropagateVariances_CartLocal_Diagonal(), PropagateVariances_LocalCart(), PropagateVariances_LocalPolar_Diagonal(), Rotate_CartLocal(), sf_prec_adj_msrs, UnloadBlock(), UpdateMsrRecordStats(), v_msr_db_map_, v_precAdjMsrsFull_, and VerticalAngle().

Referenced by fillSinexExample(), and PrintAdjMeasurements_GXY().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurementStatistics()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurementStatistics ( const char cardinal,
const it_vmsr_t & _it_msr,
bool initialise_dbindex = true )
private

Definition at line 13226 of file dnaadjust.cpp.

13227{
13228 UINT16 PRECISION_STAT(2);
13229
13230 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
13231 adj_file << StringFromTW(removeNegativeZero(_it_msr->NStat, 2), STAT, PRECISION_STAT); // N Stat
13232 else
13233 adj_file << std::setw(STAT) << std::setprecision(2) << std::fixed << std::right <<
13234 removeNegativeZero(_it_msr->NStat, 2); // N Stat
13235
13236 if (projectSettings_.o._adj_msr_tstat)
13237 {
13238 if (isAdjustmentQuestionable_ || (fabs(_it_msr->NStat) > criticalValue_ * 4.0))
13239 adj_file << StringFromTW(removeNegativeZero(_it_msr->TStat, 2), STAT, PRECISION_STAT); // T Stat
13240 else
13241 adj_file << std::setw(STAT) << std::setprecision(2) << std::fixed << std::right <<
13242 removeNegativeZero(_it_msr->TStat, 2); // T Stat
13243 }
13244
13245 adj_file << std::setw(REL) << std::setprecision(2) << std::fixed << std::right << _it_msr->PelzerRel; // Pelzer's reliability
13246
13247 // Print measurement correction
13248 PrintMeasurementCorrection(cardinal, _it_msr);
13249
13250 // Print asterisk for values which exceed the critical value
13251 if (fabs(_it_msr->NStat) > criticalValue_)
13252 adj_file << std::setw(OUTLIER) << std::right << "*";
13253 else
13254 adj_file << std::setw(OUTLIER) << std::right << " ";
13255
13256 // Print measurement database ids
13257 if (projectSettings_.o._database_ids)
13258 PrintMeasurementDatabaseID(_it_msr, initialise_dbindex);
13259
13260 adj_file << std::endl;
13261}

References adj_file, criticalValue_, isAdjustmentQuestionable_, OUTLIER(), PrintMeasurementCorrection(), PrintMeasurementDatabaseID(), projectSettings_, REL(), removeNegativeZero(), STAT(), and StringFromTW().

Referenced by fillSinexExample(), PrintAdjMeasurementsAngular(), and PrintAdjMeasurementsLinear().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintIgnoredAdjMeasurements()

void dynadjust::networkadjust::dna_adjust::PrintIgnoredAdjMeasurements ( bool printHeader)
private

Definition at line 11977 of file dnaadjust.cpp.

11978{
11979 // Print heading
11980 adj_file << std::endl;
11981 std::string table_heading("Ignored Measurements (a-posteriori)");
11982 PrintAdjMeasurementsHeader(printHeader, table_heading,
11983 ignoredMsrs, 0, false);
11984
11985 vUINT32 ignored_msrs;
11986 it_vUINT32 _it_ign;
11987 it_vmsr_t _it_msr, _it_tmp;
11988
11989 for (_it_msr = bmsBinaryRecords_.begin();
11990 _it_msr != bmsBinaryRecords_.end();
11991 ++_it_msr)
11992 {
11993 switch (_it_msr->measType)
11994 {
11995 case 'D': // Direction set
11996 // Don't include internal directions
11997 if (_it_msr->measStart > xMeas)
11998 continue;
11999 break;
12000 case 'G': // GPS Baseline cluster
12001 case 'X': // GPS Baseline cluster
12002 case 'Y': // GPS Point cluster
12003 // Don't include covariance terms
12004 if (_it_msr->measStart != xMeas)
12005 continue;
12006
12007 if (_it_msr->vectorCount1 > 1)
12008 if ((_it_msr->vectorCount1 - _it_msr->vectorCount2) > 1)
12009 continue;
12010 break;
12011 }
12012
12013 // Include ignored measurements
12014 if (_it_msr->ignore)
12015 {
12016 _it_tmp = _it_msr;
12017 // Check each ignored measurement for the presence of
12018 // stations that are invalid (and therefore unadjusted).
12020 continue;
12021
12022 ignored_msrs.push_back(static_cast<UINT32>(_it_tmp - bmsBinaryRecords_.begin()));
12023 }
12024 }
12025
12026 if (ignored_msrs.empty())
12027 {
12028 adj_file << std::endl << std::endl;
12029 return;
12030 }
12031
12032 // Update Ignored measurement records
12033 UINT32 clusterID(MAX_UINT32_VALUE);
12034
12035 // Initialise ignored measurements on the first adjustment only.
12036 // Test for zero values (of the first ignored measurement) to determine
12037 // if Ignored measurements have been updated. These values are initialised
12038 // at 0. by msr_t() in dnameasurement.hpp. If this test fails, ignored
12039 // measurements will not be calculated correctly (since the Update...()
12040 // methods will refer to adjusted values)
12041 _it_msr = bmsBinaryRecords_.begin() + ignored_msrs.at(0);
12042 bool storeOriginalMeasurement(false);
12043 if (_it_msr->measAdj == 0. && _it_msr->measCorr == 0. && _it_msr->preAdjCorr == 0. && _it_msr->preAdjMeas == 0.)
12044 storeOriginalMeasurement = true;
12045
12046 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end());
12047
12048 // Reduce measurements and compute stats
12049 for (_it_ign = ignored_msrs.begin(); _it_ign != ignored_msrs.end(); ++_it_ign)
12050 {
12051 _it_msr = bmsBinaryRecords_.begin() + (*_it_ign);
12052
12053 // Update ignore measurements
12054 UpdateIgnoredMeasurements(&_it_msr, storeOriginalMeasurement);
12055 }
12056
12057 // Print measurements
12058 for (_it_ign = ignored_msrs.begin(); _it_ign != ignored_msrs.end(); ++_it_ign)
12059 {
12060 _it_msr = bmsBinaryRecords_.begin() + (*_it_ign);
12061
12062 // When a target direction is found, continue to next element.
12063 if (_it_msr->measType == 'D')
12064 if (_it_msr->vectorCount1 < 1)
12065 continue;
12066
12067 if (_it_msr->measStart != xMeas)
12068 continue;
12069
12070 // For cluster measurements, only print measurement type if
12071 // this measurement is from a new cluster
12072 switch (_it_msr->measType)
12073 {
12074 case 'D': // Direction set
12075 case 'X': // GPS Baseline cluster
12076 case 'Y': // GPS Point cluster
12077 if (_it_msr->clusterID != clusterID)
12078 {
12079 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
12080 clusterID = _it_msr->clusterID;
12081 }
12082 else
12083 adj_file << " ";
12084 break;
12085 default:
12086 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
12087 }
12088
12089#ifdef _MSDEBUG
12090 switch (_it_msr->measType)
12091 {
12092 case 'L': // Level difference
12093 break;
12094 }
12095#endif
12096
12097 UINT32 design_row(0);
12098
12099 // normal format
12100 switch (_it_msr->measType)
12101 {
12102 case 'A': // Horizontal angle
12103 PrintCompMeasurements_A(0, _it_msr, design_row, ignoredMsrs);
12104 break;
12105 case 'B': // Geodetic azimuth
12106 case 'K': // Astronomic azimuth
12107 case 'V': // Zenith distance
12108 case 'Z': // Vertical angle
12109 PrintCompMeasurements_BKVZ(0, _it_msr, design_row, ignoredMsrs);
12110 break;
12111 case 'C': // Chord dist
12112 case 'E': // Ellipsoid arc
12113 case 'L': // Level difference
12114 case 'M': // MSL arc
12115 case 'S': // Slope distance
12116 PrintCompMeasurements_CELMS(_it_msr, design_row, ignoredMsrs);
12117 break;
12118 case 'D': // Direction set
12119 PrintCompMeasurements_D(_it_msr, design_row, true);
12120 break;
12121 case 'H': // Orthometric height
12122 case 'R': // Ellipsoidal height
12123 PrintCompMeasurements_HR(0, _it_msr, design_row, ignoredMsrs);
12124 break;
12125 case 'I': // Astronomic latitude
12126 case 'J': // Astronomic longitude
12127 case 'P': // Geodetic latitude
12128 case 'Q': // Geodetic longitude
12129 PrintCompMeasurements_IJPQ(0, _it_msr, design_row, ignoredMsrs);
12130 break;
12131 case 'G': // GPS Baseline (treat as single-baseline cluster)
12132 case 'X': // GPS Baseline cluster
12133 case 'Y': // GPS Point cluster
12134 PrintCompMeasurements_GXY(0, _it_msr, design_row, ignoredMsrs);
12135 break;
12136 }
12137
12138 }
12139
12140 adj_file << std::endl << std::endl;
12141
12142}
bool IgnoredMeasurementContainsInvalidStation(pit_vmsr_t _it_msr)
void UpdateIgnoredMeasurements(pit_vmsr_t _it_msr, bool storeOriginalMeasurement)

References adj_file, bmsBinaryRecords_, IgnoredMeasurementContainsInvalidStation(), ignoredMsrs, MAX_UINT32_VALUE(), PAD2(), PrintAdjMeasurementsHeader(), PrintCompMeasurements_A(), PrintCompMeasurements_BKVZ(), PrintCompMeasurements_CELMS(), PrintCompMeasurements_D(), PrintCompMeasurements_GXY(), PrintCompMeasurements_HR(), PrintCompMeasurements_IJPQ(), UpdateIgnoredMeasurements(), v_blockStationsMapUnique_, and xMeas.

Referenced by fillSinexExample(), and PrintAdjustedNetworkMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_A()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_A ( it_vmsr_t & _it_msr)
private

Definition at line 13263 of file dnaadjust.cpp.

13264{
13265 // normal format
13266 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
13267 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
13268 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station3).stationName;
13269
13270 // Print angular measurement, taking care of user requirements for
13271 // type, format and precision
13272 PrintAdjMeasurementsAngular(' ', _it_msr);
13273}

References adj_file, bstBinaryRecords_, PrintAdjMeasurementsAngular(), and STATION().

Referenced by fillSinexExample(), and PrintAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_CELMS()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_CELMS ( it_vmsr_t & _it_msr)
private

Definition at line 13289 of file dnaadjust.cpp.

13290{
13291 // normal format
13292 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
13293 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
13294 adj_file << std::left << std::setw(STATION) << " ";
13295
13296 PrintAdjMeasurementsLinear(' ', _it_msr);
13297}

References adj_file, bstBinaryRecords_, PrintAdjMeasurementsLinear(), and STATION().

Referenced by fillSinexExample(), and PrintAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_D()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_D ( it_vmsr_t & _it_msr)
private

Definition at line 13303 of file dnaadjust.cpp.

13304{
13305 // normal format
13306 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
13307 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
13308 adj_file << std::left << std::setw(STATION) << " ";
13309
13310 std::string ignoreFlag(" ");
13311 if (_it_msr->ignore)
13312 ignoreFlag = "*";
13313
13314 UINT32 a, angle_count(_it_msr->vectorCount2 - 1);
13315 UINT32 skip(0), ignored(_it_msr->vectorCount1 - _it_msr->vectorCount2);
13316
13317 adj_file << std::setw(PAD3) << std::left << ignoreFlag << std::setw(PAD2) << std::left << angle_count;
13318
13319 if (projectSettings_.o._database_ids)
13320 {
13321 // Measured + Computed + Correction + Measured + Adjusted + Residual + N Stat + T Stat + Pelzer + Pre Adj Corr + Outlier
13322 UINT32 b(MSR + MSR + CORR + PREC + PREC + PREC + STAT + REL + PACORR + OUTLIER);
13323 if (projectSettings_.o._adj_msr_tstat)
13324 b += STAT;
13325 adj_file << std::setw(b) << " ";
13326
13328 }
13329 adj_file << std::endl;
13330
13331 _it_msr++;
13332
13333 for (a=0; a<angle_count; ++a)
13334 {
13335 // cater for ignored directions
13336 if (_it_msr->ignore)
13337 {
13338 while (skip < ignored)
13339 {
13340 skip++;
13341 _it_msr++;
13342 if (!_it_msr->ignore)
13343 break;
13344 }
13345 }
13346
13347 adj_file << std::left << std::setw(PAD2) << " "; // measurement type
13348 adj_file << std::left << std::setw(STATION) << " "; // station1 (Instrument)
13349 adj_file << std::left << std::setw(STATION) << " "; // station2 (RO)
13350 adj_file << std::left << std::setw(STATION) <<
13351 bstBinaryRecords_.at(_it_msr->station2).stationName; // target
13352
13353 // Print angular measurement, taking care of user requirements for
13354 // type, format and precision
13355 PrintAdjMeasurementsAngular(' ', _it_msr);
13356
13357 _it_msr++;
13358 }
13359}

References adj_file, bstBinaryRecords_, CORR(), MSR(), OUTLIER(), PACORR(), PAD2(), PAD3(), PREC(), PrintAdjMeasurementsAngular(), PrintMeasurementDatabaseID(), projectSettings_, REL(), STAT(), and STATION().

Referenced by fillSinexExample(), and PrintAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_HR()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_HR ( it_vmsr_t & _it_msr)
private

Definition at line 13990 of file dnaadjust.cpp.

13991{
13992 // normal format
13993 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
13994 adj_file << std::left << std::setw(STATION) << " ";
13995 adj_file << std::left << std::setw(STATION) << " ";
13996
13997 PrintAdjMeasurementsLinear(' ', _it_msr);
13998}

References adj_file, bstBinaryRecords_, PrintAdjMeasurementsLinear(), and STATION().

Referenced by fillSinexExample(), and PrintAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_IJPQ()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_IJPQ ( it_vmsr_t & _it_msr)
private

Definition at line 14001 of file dnaadjust.cpp.

14002{
14003 // normal format
14004 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
14005 adj_file << std::left << std::setw(STATION) << " ";
14006 adj_file << std::left << std::setw(STATION) << " ";
14007
14008 // Print angular measurement, taking care of user requirements for
14009 // type, format and precision
14010 PrintAdjMeasurementsAngular(' ', _it_msr);
14011}

References adj_file, bstBinaryRecords_, PrintAdjMeasurementsAngular(), and STATION().

Referenced by fillSinexExample(), and PrintAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_BKVZ()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_BKVZ ( it_vmsr_t & _it_msr)
private

Definition at line 13276 of file dnaadjust.cpp.

13277{
13278 // normal format
13279 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
13280 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
13281 adj_file << std::left << std::setw(STATION) << " ";
13282
13283 // Print angular measurement, taking care of user requirements for
13284 // type, format and precision
13285 PrintAdjMeasurementsAngular(' ', _it_msr);
13286}

References adj_file, bstBinaryRecords_, PrintAdjMeasurementsAngular(), and STATION().

Referenced by fillSinexExample(), and PrintAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_GXY()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_GXY ( it_vmsr_t & _it_msr,
const uint32_uint32_pair & b_pam )
private

Definition at line 13588 of file dnaadjust.cpp.

13589{
13590 // Is this a Y cluster specified in latitude, longitude, height?
13591 if (_it_msr->measType == 'Y')
13592 {
13593 if (_it_msr->station3 == LLH_type_i)
13594 {
13595 // Print phi, lambda, H
13597 return;
13598 }
13599 }
13600
13601 UINT32 cluster_msr, cluster_count(_it_msr->vectorCount1), covariance_count;
13602 bool nextElement(false);
13603
13604 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
13605 {
13606 if (nextElement)
13607 adj_file << std::left << std::setw(PAD2) << _it_msr->measType;
13608 else
13609 nextElement = true;
13610
13611 covariance_count = _it_msr->vectorCount2;
13612
13613 // first station
13614 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station1).stationName;
13615
13616 // Print second station?
13617 switch (_it_msr->measType)
13618 {
13619 case 'G':
13620 case 'X':
13621 adj_file << std::left << std::setw(STATION) << bstBinaryRecords_.at(_it_msr->station2).stationName;
13622 break;
13623 default:
13624 adj_file << std::left << std::setw(STATION) << " ";
13625 }
13626
13627 // third station
13628 adj_file << std::left << std::setw(STATION) << " ";
13629
13630 // Print adjusted GNSS baseline measurements in alternate units?
13631 if (projectSettings_.o._adj_gnss_units != XYZ_adj_gnss_ui &&
13632 _it_msr->measType != 'Y')
13633 PrintAdjGNSSAlternateUnits(_it_msr, b_pam);
13634 else
13635 {
13636 // Print X
13637 PrintAdjMeasurementsLinear('X', _it_msr);
13638
13639 // Print Y
13640 _it_msr++;
13641 PrintAdjMeasurementsLinear('Y', _it_msr);
13642
13643 // Print Z
13644 _it_msr++;
13645 PrintAdjMeasurementsLinear('Z', _it_msr);
13646 }
13647
13648 // skip covariances until next baseline
13649 _it_msr += covariance_count * 3;
13650
13651 if (covariance_count > 0)
13652 _it_msr++;
13653 }
13654}
void PrintAdjGNSSAlternateUnits(it_vmsr_t &_it_msr, const uint32_uint32_pair &b_pam)
void PrintAdjMeasurements_YLLH(it_vmsr_t &_it_msr)

References adj_file, bstBinaryRecords_, LLH_type_i, PAD2(), PrintAdjGNSSAlternateUnits(), PrintAdjMeasurements_YLLH(), PrintAdjMeasurementsLinear(), projectSettings_, STATION(), and XYZ_adj_gnss_ui.

Referenced by fillSinexExample(), and PrintAdjMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjMeasurements_YLLH()

void dynadjust::networkadjust::dna_adjust::PrintAdjMeasurements_YLLH ( it_vmsr_t & _it_msr)
private

Definition at line 13435 of file dnaadjust.cpp.

13436{
13437 // Get an iterator to this measurement which will be needed later when
13438 // obtaining variance matrices via GetGPSVarianceMatrix()
13439 it_vmsr_t _it_msr_begin(_it_msr);
13440
13441 // create a temporary copy of this Y measurement and transform/propagate
13442 // cartesian elements to geographic
13443 vmsr_t y_msr;
13445
13446 it_vmsr_t _it_y_msr(y_msr.begin());
13447 snprintf(_it_y_msr->coordType, STN_TYPE_WIDTH, "%s", LLH_type);
13448
13449 UINT32 covr, cluster_msr, cluster_count(_it_y_msr->vectorCount1), covariance_count;
13450 matrix_2d mpositions(cluster_count * 3, 1);
13451 double latitude, longitude, height;
13452
13453 it_vstn_t stn1_it;
13454
13455 // 1. Convert coordinates from cartesian to geographic
13457
13458 _it_y_msr = y_msr.begin();
13459
13460 matrix_2d var_cart_adj(3, 3), var_geo_adj(3, 3);
13461
13462 // 2. Convert adjusted precisions
13463 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
13464 {
13465 covr = cluster_msr * 3;
13466 covariance_count = _it_y_msr->vectorCount2;
13467
13468 var_cart_adj.put(0, 0, _it_y_msr->measAdjPrec);
13469 _it_y_msr++;
13470 var_cart_adj.put(1, 1, _it_y_msr->measAdjPrec);
13471 _it_y_msr++;
13472 var_cart_adj.put(2, 2, _it_y_msr->measAdjPrec);
13473
13474 latitude = mpositions.get(covr, 0);
13475 longitude = mpositions.get(covr+1, 0);
13476 height = mpositions.get(covr+2, 0);
13477
13478 PropagateVariances_GeoCart<double>(var_cart_adj, &var_geo_adj,
13479 latitude, longitude, height,
13480 datum_.GetEllipsoidRef(),
13481 false); // Cartesian -> Geographic
13482
13483 _it_y_msr-=2;
13484 _it_y_msr->measAdjPrec = var_geo_adj.get(0, 0);
13485
13486 _it_y_msr++;
13487 _it_y_msr->measAdjPrec = var_geo_adj.get(1, 1);
13488
13489 _it_y_msr++;
13490 _it_y_msr->measAdjPrec = var_geo_adj.get(2, 2);
13491
13492 // skip covariances until next point
13493 _it_y_msr += covariance_count * 3;
13494
13495 if (covariance_count > 0)
13496 _it_y_msr++;
13497 }
13498
13499 _it_y_msr = y_msr.begin();
13500
13501 // 3. Convert apriori measurement precisions
13502
13503 // Get measurement cartesian variance matrix
13504 matrix_2d var_cart;
13505 GetGPSVarianceMatrix(_it_msr_begin, &var_cart);
13506 var_cart.filllower();
13507
13508 // Propagate the cartesian variance matrix to geographic
13510 mpositions,
13511 datum_.GetEllipsoidRef(),
13512 false); // Cartesian -> Geographic
13513
13514 SetGPSVarianceMatrix(_it_y_msr, var_cart);
13515
13516 // Now print the temporary measurement
13517 bool nextElement(false);
13518
13519 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
13520 {
13521 stn1_it = bstBinaryRecords_.begin() + _it_y_msr->station1;
13522
13523 if (nextElement)
13524 adj_file << std::left << std::setw(PAD2) << _it_y_msr->measType;
13525 else
13526 nextElement = true;
13527
13528 covariance_count = _it_y_msr->vectorCount2;
13529
13530 // update statistics
13531 // Latitude
13532 _it_y_msr->residualPrec = _it_y_msr->term2 - _it_y_msr->measAdjPrec;
13533 if (_it_y_msr->residualPrec < 0.0)
13534 _it_y_msr->residualPrec = fabs(_it_y_msr->residualPrec);
13535 _it_y_msr->PelzerRel = sqrt(_it_y_msr->term2) / sqrt(_it_y_msr->residualPrec);
13536 if (_it_y_msr->PelzerRel < 0. || _it_y_msr->PelzerRel > STABLE_LIMIT)
13537 _it_y_msr->PelzerRel = UNRELIABLE;
13538 _it_y_msr->NStat = _it_y_msr->measCorr / sqrt(_it_y_msr->residualPrec);
13539 _it_y_msr++;
13540
13541 // Longitude
13542 _it_y_msr->residualPrec = _it_y_msr->term3 - _it_y_msr->measAdjPrec;
13543 if (_it_y_msr->residualPrec < 0.0)
13544 _it_y_msr->residualPrec = fabs(_it_y_msr->residualPrec);
13545 _it_y_msr->PelzerRel = sqrt(_it_y_msr->term3) / sqrt(_it_y_msr->residualPrec);
13546 if (_it_y_msr->PelzerRel < 0. || _it_y_msr->PelzerRel > STABLE_LIMIT)
13547 _it_y_msr->PelzerRel = UNRELIABLE;
13548 _it_y_msr->NStat = _it_y_msr->measCorr / sqrt(_it_y_msr->residualPrec);
13549 _it_y_msr++;
13550
13551 // Orthometric height
13552 _it_y_msr->residualPrec = _it_y_msr->term4 - _it_y_msr->measAdjPrec;
13553 if (_it_y_msr->residualPrec < 0.0)
13554 _it_y_msr->residualPrec = fabs(_it_y_msr->residualPrec);
13555 _it_y_msr->PelzerRel = sqrt(_it_y_msr->term4) / sqrt(_it_y_msr->residualPrec);
13556 if (_it_y_msr->PelzerRel < 0. || _it_y_msr->PelzerRel > STABLE_LIMIT)
13557 _it_y_msr->PelzerRel = UNRELIABLE;
13558 _it_y_msr->NStat = _it_y_msr->measCorr / sqrt(_it_y_msr->residualPrec);
13559
13560 _it_y_msr-=2;
13561
13562 // first, second, third stations
13563 adj_file << std::left << std::setw(STATION) <<
13564 stn1_it->stationName <<
13565 std::left << std::setw(STATION) << " " << // second station
13566 std::left << std::setw(STATION) << " "; // third station
13567
13568 // Print X
13569 PrintAdjMeasurementsAngular('P', _it_y_msr);
13570
13571 // Print Y
13572 _it_y_msr++;
13573 PrintAdjMeasurementsAngular('L', _it_y_msr);
13574
13575 // Print Z
13576 _it_y_msr++;
13577 PrintAdjMeasurementsLinear('H', _it_y_msr);
13578
13579 // skip covariances until next point
13580 _it_y_msr += covariance_count * 3;
13581
13582 if (covariance_count > 0)
13583 _it_y_msr++;
13584 }
13585
13586}
void PropagateVariances_GeoCart(const matrix_2d mvariances, matrix_2d *mvariances_mod, const T &latitude, const T &longitude, const T &height, matrix_2d &mrotations, const CDnaEllipsoid *ellipsoid, bool GEO_TO_CART, bool CALCULATE_ROTATIONS)

References adj_file, adjustedMsrs, bmsBinaryRecords_, bstBinaryRecords_, CopyClusterMsr(), datum_, dynadjust::math::matrix_2d::filllower(), dynadjust::math::matrix_2d::get(), GetGPSVarianceMatrix(), LLH_type(), PAD2(), PrintAdjMeasurementsAngular(), PrintAdjMeasurementsLinear(), PropagateVariances_GeoCart(), PropagateVariances_GeoCart_Cluster(), ReduceYLLHMeasurementsforPrinting(), SetGPSVarianceMatrix(), STABLE_LIMIT(), STATION(), STN_TYPE_WIDTH(), and UNRELIABLE().

Referenced by fillSinexExample(), and PrintAdjMeasurements_GXY().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReduceYLLHMeasurementsforPrinting()

void dynadjust::networkadjust::dna_adjust::ReduceYLLHMeasurementsforPrinting ( vmsr_t & y_msr,
matrix_2d & mpositions,
printMeasurementsMode print_mode )
private

Definition at line 13361 of file dnaadjust.cpp.

13362{
13363 it_vmsr_t _it_y_msr(y_msr.begin());
13364 UINT32 covr, cluster_msr, cluster_count(_it_y_msr->vectorCount1), covariance_count;
13365 it_vstn_t stn1_it;
13366 double latitude, longitude, height, x, y, z;
13367
13368 for (cluster_msr=0; cluster_msr<cluster_count; ++cluster_msr)
13369 {
13370 covr = cluster_msr * 3;
13371 covariance_count = _it_y_msr->vectorCount2;
13372
13373 stn1_it = bstBinaryRecords_.begin() + _it_y_msr->station1;
13374
13375 // transform computed values to geographic
13376 switch (print_mode)
13377 {
13378 case computedMsrs:
13379 x = _it_y_msr->term1;
13380 _it_y_msr++;
13381 y = _it_y_msr->term1;
13382 _it_y_msr++;
13383 z = _it_y_msr->term1;
13384 break;
13385 case adjustedMsrs:
13386 default:
13387 x = _it_y_msr->measAdj;
13388 _it_y_msr++;
13389 y = _it_y_msr->measAdj;
13390 _it_y_msr++;
13391 z = _it_y_msr->measAdj;
13392 break;
13393 }
13394
13395 // Convert to geographic
13396 CartToGeo<double>(x, y, z,
13397 &latitude, &longitude, &height,
13398 datum_.GetEllipsoidRef());
13399
13400 // Reduce ellipsoidal height to orthometric height
13401 if (fabs(stn1_it->geoidSep) > PRECISION_1E4)
13402 height -= stn1_it->geoidSep;
13403
13404 // Assign computed values
13405 _it_y_msr -= 2;
13406 _it_y_msr->measAdj = latitude;
13407 _it_y_msr->measCorr = latitude - _it_y_msr->preAdjMeas;
13408 mpositions.put(covr, 0, latitude);
13409 _it_y_msr++;
13410 _it_y_msr->measAdj = longitude;
13411 _it_y_msr->measCorr = longitude - _it_y_msr->preAdjMeas;
13412 mpositions.put(covr+1, 0, longitude);
13413 _it_y_msr++;
13414 _it_y_msr->measAdj = height;
13415 _it_y_msr->measCorr = height - _it_y_msr->preAdjMeas;
13416 mpositions.put(covr+2, 0, height);
13417
13418 // skip covariances until next point
13419 _it_y_msr += covariance_count * 3;
13420
13421 if (covariance_count > 0)
13422 _it_y_msr++;
13423 }
13424}

References adjustedMsrs, bstBinaryRecords_, CartToGeo(), computedMsrs, datum_, PRECISION_1E4(), and dynadjust::math::matrix_2d::put().

Referenced by fillSinexExample(), PrintAdjMeasurements_YLLH(), and PrintCompMeasurements_YLLH().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjStation()

void dynadjust::networkadjust::dna_adjust::PrintAdjStation ( std::ostream & os,
const UINT32 & block,
const UINT32 & stn,
const UINT32 & mat_idx,
const matrix_2d * stationEstimates,
matrix_2d * stationVariances,
bool recomputeGeographicCoords,
bool updateGeographicCoords,
bool reapplyTypeBUncertainties )
private

Definition at line 9590 of file dnaadjust.cpp.

9595{
9596 double estLatitude, estLongitude, estHeight, E(0.), N(0.), Zo(-1.);
9597
9598 it_vstn_t stn_it(bstBinaryRecords_.begin());
9599 stn_it += stn;
9600
9601 // station and constraint
9602 os << std::setw(STATION) << std::left << stn_it->stationName;
9603 os << std::setw(CONSTRAINT) << std::left << stn_it->stationConst;
9604
9605 // Are station corrections required?
9606 // If so, update the original stations matrix
9607 if (projectSettings_.o._init_stn_corrections || projectSettings_.o._stn_corr)
9608 {
9609 estHeight = stn_it->initialHeight;
9610 if (stn_it->suppliedHeightRefFrame == ORTHOMETRIC_type_i)
9611 estHeight = stn_it->initialHeight + stn_it->geoidSep;
9612
9613 // update initial estimates
9615 stn_it->initialLatitude,
9616 stn_it->initialLongitude,
9617 estHeight,
9618 v_originalStations_.at(block).getelementref(mat_idx, 0),
9619 v_originalStations_.at(block).getelementref(mat_idx+1, 0),
9620 v_originalStations_.at(block).getelementref(mat_idx+2, 0),
9621 datum_.GetEllipsoidRef());
9622 }
9623
9624 // Are geographic coordinates required?
9625 if (recomputeGeographicCoords ||
9626 projectSettings_.o._stn_coord_types.find("P") != std::string::npos ||
9627 projectSettings_.o._stn_coord_types.find("L") != std::string::npos ||
9628 projectSettings_.o._stn_coord_types.find("H") != std::string::npos ||
9629 projectSettings_.o._stn_coord_types.find("h") != std::string::npos ||
9630 projectSettings_.o._stn_coord_types.find("N") != std::string::npos ||
9631 projectSettings_.o._stn_coord_types.find("z") != std::string::npos)
9632 {
9634 stationEstimates->get(mat_idx, 0), // X
9635 stationEstimates->get(mat_idx+1, 0), // Y
9636 stationEstimates->get(mat_idx+2, 0), // Z
9637 &estLatitude, // Lat
9638 &estLongitude, // Long
9639 &estHeight, // E.Height
9640 datum_.GetEllipsoidRef());
9641
9642 if (updateGeographicCoords)
9643 {
9644 stn_it->currentLatitude = estLatitude;
9645 stn_it->currentLongitude = estLongitude;
9646 stn_it->currentHeight = estHeight;
9647 }
9648 }
9649
9650 // Are projection coordinates required?
9651 if (projectSettings_.o._stn_coord_types.find("E") != std::string::npos ||
9652 projectSettings_.o._stn_coord_types.find("N") != std::string::npos ||
9653 projectSettings_.o._stn_coord_types.find("z") != std::string::npos)
9654 {
9655 GeoToGrid<double>(estLatitude, estLongitude, &E, &N, &Zo,
9656 datum_.GetEllipsoidRef(),
9657 &projection_, true); // compute zone
9658 }
9659
9660 for (_it_str_const it_s=projectSettings_.o._stn_coord_types.begin(); it_s!=projectSettings_.o._stn_coord_types.end(); ++it_s)
9661 {
9662 char c = it_s[0];
9663
9664 switch (c)
9665 {
9666 case 'P':
9667 // latitude
9668 // Which angular format?
9669 if (projectSettings_.o._angular_type_stn == DMS)
9670 os << std::setprecision(4 + PRECISION_SEC_STN) << std::fixed << std::right << std::setw(LAT_EAST) <<
9671 RadtoDms(estLatitude);
9672 else
9673 os << std::setprecision(4 + PRECISION_SEC_STN) << std::fixed << std::right << std::setw(LAT_EAST) <<
9674 Degrees(estLatitude);
9675 break;
9676 case 'L':
9677 // longitude
9678 // Which angular format?
9679 if (projectSettings_.o._angular_type_stn == DMS)
9680 os << std::setprecision(4+PRECISION_SEC_STN) << std::fixed << std::right << std::setw(LON_NORTH) <<
9681 RadtoDmsL(estLongitude);
9682 else
9683 os << std::setprecision(4 + PRECISION_SEC_STN) << std::fixed << std::right << std::setw(LON_NORTH) <<
9684 DegreesL(estLongitude);
9685 break;
9686 case 'E':
9687 // Easting
9688 os << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(LAT_EAST) << E;
9689 break;
9690 case 'N':
9691 // Northing
9692 os << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(LON_NORTH) << N;
9693 break;
9694 case 'z':
9695 // Zone
9696 os << std::setprecision(0) << std::fixed << std::right << std::setw(ZONE) << Zo;
9697 break;
9698 case 'H':
9699 // Orthometric height
9701 os << std::right << StringFromTW((estHeight - stn_it->geoidSep), HEIGHT, PRECISION_MTR_STN);
9702 else
9703 os << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(HEIGHT) <<
9704 estHeight - stn_it->geoidSep;
9705 break;
9706 case 'h':
9707 // Ellipsoidal height
9709 os << std::right << StringFromTW(estHeight, HEIGHT, PRECISION_MTR_STN);
9710 else
9711 os << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(HEIGHT) <<
9712 estHeight;
9713 break;
9714 case 'X':
9715 // Cartesian X
9716 os << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(XYZ) <<
9717 stationEstimates->get(mat_idx, 0);
9718 break;
9719 case 'Y':
9720 // Cartesian Y
9721 os << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(XYZ) <<
9722 stationEstimates->get(mat_idx+1, 0);
9723 break;
9724 case 'Z':
9725 // Cartesian Z
9726 os << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(XYZ) <<
9727 stationEstimates->get(mat_idx+2, 0);
9728 break;
9729 }
9730 }
9731
9732 os << std::setw(PAD2) << " ";
9733
9734 // Standard deviation in local reference frame
9735 matrix_2d var_local(3, 3), var_cart(3, 3);
9736
9737 // To minimise re-computation when printing to .xyz, .adj and .apu, the type b uncertainties are
9738 // added to the estimated variances held in memory. This is not a problem since, if adjust is
9739 // re-run and the user does not supply type b uncertainties, the variances held in memory will be
9740 // re-estimated which will overwrite the type b values that were previously applied.
9741
9742 // Add type B uncertainties (if required)
9743 if (reapplyTypeBUncertainties &&
9744 (projectSettings_.o._apply_type_b_global || projectSettings_.o._apply_type_b_file))
9745 {
9746 if (v_typeBUncertaintyMethod_.at(stn).apply)
9747 {
9748 // apply local first
9749 if (v_typeBUncertaintyMethod_.at(stn).method == type_b_local)
9750 {
9751 // Add the cartesian type b variances
9752 // Note: Cartesian variances for this station were computed in dna_io_tbu::reduce_uncertainties_local(...)
9753 //var_cart.add(v_typeBUncertaintiesLocal_.at(v_stationTypeBMap_.at(stn).second).type_b);
9754 stationVariances->blockadd(mat_idx, mat_idx,
9755 v_typeBUncertaintiesLocal_.at(v_stationTypeBMap_.at(stn).second).type_b,
9756 0, 0, 3, 3);
9757 }
9758 else if (v_typeBUncertaintyMethod_.at(stn).method == type_b_global)
9759 {
9760 // Compute cartesian variances for this station from the global uncertainty
9761 // Note: this needs to be done for each site from the global type b uncertainties entered
9762 // via the command line
9763 matrix_2d var_cart_typeb(3, 3);
9765 estLatitude, estLongitude, true);
9766
9767 // Add the cartesian type b variances
9768 //var_cart.add(var_cart_typeb);
9769 stationVariances->blockadd(mat_idx, mat_idx,
9770 var_cart_typeb, 0, 0, 3, 3);
9771 }
9772 }
9773 }
9774
9775 var_cart.copyelements(0, 0, stationVariances, mat_idx, mat_idx, 3, 3);
9776
9777 PropagateVariances_LocalCart(var_cart, var_local,
9778 estLatitude, estLongitude, false);
9779
9781 os <<
9782 StringFromTW(sqrt(var_local.get(0, 0)), STDDEV, PRECISION_MTR_STN) <<
9783 StringFromTW(sqrt(var_local.get(1, 1)), STDDEV, PRECISION_MTR_STN) <<
9784 StringFromTW(sqrt(var_local.get(2, 2)), STDDEV, PRECISION_MTR_STN);
9785 else
9786 os <<
9787 std::setw(STDDEV) << std::right << StringFromT(sqrt(var_local.get(0, 0)), PRECISION_MTR_STN) <<
9788 std::setw(STDDEV) << std::right << StringFromT(sqrt(var_local.get(1, 1)), PRECISION_MTR_STN) <<
9789 std::setw(STDDEV) << std::right << StringFromT(sqrt(var_local.get(2, 2)), PRECISION_MTR_STN);
9790
9791 if (projectSettings_.o._stn_corr)
9792 {
9793 double cor_e, cor_n, cor_up;
9795 v_originalStations_.at(block).get(mat_idx, 0), // original X
9796 v_originalStations_.at(block).get(mat_idx+1, 0), // original Y
9797 v_originalStations_.at(block).get(mat_idx+2, 0), // original Z
9798 stationEstimates->get(mat_idx, 0), // estimated X
9799 stationEstimates->get(mat_idx+1, 0), // estimated Y
9800 stationEstimates->get(mat_idx+2, 0), // estimated Z
9801 stn_it->currentLatitude,
9802 stn_it->currentLongitude,
9803 &cor_e, &cor_n, &cor_up); // corrections in the local reference frame
9804
9805 os << std::setw(PAD2) << " " <<
9806 std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(HEIGHT) << cor_e <<
9807 std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(HEIGHT) << cor_n <<
9808 std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(HEIGHT) << cor_up;
9809 }
9810
9811 // description
9812 os << std::setw(PAD2) << " " << std::left << stn_it->description;
9813 os << std::endl;
9814
9815}
const UINT16 XYZ(15)
const UINT16 HEIGHT(11)
const UINT16 LAT_EAST(14)
const UINT16 LON_NORTH(15)
const UINT16 CONSTRAINT(5)
const UINT16 ZONE(8)
T DegreesL(const T &radians)
T RadtoDmsL(const T &dRadians)
void ComputeLocalElements3D(const T X1, const T Y1, const T Z1, const T X2, const T Y2, const T Z2, const T currentLatitude, const T currentLongitude, T *local_12e, T *local_12n, T *local_12up)
void GeoToGrid(const T &Latitude, const T &Longitude, T *easting, T *northing, T *zone, const CDnaEllipsoid *ellipsoid, const CDnaProjection *projection, bool COMPUTE_ZONE)
std::string::const_iterator _it_str_const
Definition dnatypes.hpp:85
@ ORTHOMETRIC_type_i
Definition dnatypes.hpp:392

References dynadjust::math::matrix_2d::blockadd(), bstBinaryRecords_, CartToGeo(), ComputeLocalElements3D(), CONSTRAINT(), dynadjust::math::matrix_2d::copyelements(), datum_, Degrees(), DegreesL(), DMS, GeoToCart(), GeoToGrid(), dynadjust::math::matrix_2d::get(), HEIGHT(), isAdjustmentQuestionable_, LAT_EAST(), LON_NORTH(), ORTHOMETRIC_type_i, PAD2(), PRECISION_MTR_STN, PRECISION_SEC_STN, projection_, projectSettings_, PropagateVariances_LocalCart(), RadtoDms(), RadtoDmsL(), STATION(), STDDEV(), StringFromT(), StringFromTW(), dynadjust::iostreams::type_b_global, dynadjust::iostreams::type_b_local, typeBUncertaintyGlobal_, v_originalStations_, v_stationTypeBMap_, v_typeBUncertaintiesLocal_, v_typeBUncertaintyMethod_, XYZ(), and ZONE().

Referenced by fillSinexExample(), PrintAdjStations(), and PrintAdjStationsUniqueList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjStations()

void dynadjust::networkadjust::dna_adjust::PrintAdjStations ( std::ostream & os,
const UINT32 & block,
const matrix_2d * stationEstimates,
matrix_2d * stationVariances,
bool printBlockID,
bool recomputeGeographicCoords,
bool updateGeographicCoords,
bool printHeader,
bool reapplyTypeBUncertainties )
private

Definition at line 9817 of file dnaadjust.cpp.

9821{
9822 vUINT32 v_blockStations(v_parameterStationList_.at(block));
9823
9824 if (v_blockStations.size() * 3 != stationEstimates->rows())
9825 {
9826 std::stringstream ss;
9827 ss << "PrintAdjStations(): Number of estimated stations in block " << block <<
9828 " does not match the block station count." << std::endl;
9829 SignalExceptionAdjustment(ss.str(), 0);
9830 }
9831
9832 dna_io_adj adj;
9833
9834 try {
9835
9836 if (printHeader)
9837 adj.print_adj_stn_header(os);
9838
9839 // if required, sort stations according to original station file order
9840 if (projectSettings_.o._sort_stn_file_order)
9841 SortStationsbyFileOrder(v_blockStations);
9842
9843 switch (projectSettings_.a.adjust_mode)
9844 {
9845 case SimultaneousMode:
9847 projectSettings_.o._stn_coord_types, projectSettings_.o._stn_corr);
9848 break;
9849 case PhasedMode:
9850 case Phased_Block_1Mode: // only the first block is rigorous
9851 // Print stations in each block?
9852 if (projectSettings_.o._output_stn_blocks)
9853 {
9854 if (printBlockID)
9855 os << "Block " << block + 1 << std::endl;
9856 else if (projectSettings_.o._adj_stn_iteration)
9857 adj.print_adj_stn_block_header(os, block);
9858
9860 projectSettings_.o._stn_coord_types, projectSettings_.o._stn_corr);
9861 }
9862 else
9863 {
9864 if (block == 0)
9866 projectSettings_.o._stn_coord_types, projectSettings_.o._stn_corr);
9867 }
9868 break;
9869 }
9870
9871 }
9872 catch (const std::runtime_error& e) {
9873 SignalExceptionAdjustment(e.what(), 0);
9874 }
9875
9876 UINT32 mat_idx, stn;
9877
9878 // Print stations according to the user-defined sort order
9879 for (UINT32 i(0); i<v_blockStationsMap_.at(block).size(); ++i)
9880 {
9881 stn = v_blockStations.at(i);
9882 mat_idx = v_blockStationsMap_.at(block)[stn] * 3;
9883
9884 PrintAdjStation(os, block, stn, mat_idx,
9885 stationEstimates, stationVariances,
9886 recomputeGeographicCoords, updateGeographicCoords,
9887 reapplyTypeBUncertainties);
9888 }
9889
9890 os << std::endl;
9891
9892 // return sort order to alpha-numeric
9893 if (projectSettings_.o._sort_stn_file_order)
9894 SortStationsbyID(v_blockStations);
9895}
void print_adj_stn_header(std::ostream &os)
Definition dnaioadj.cpp:32
void print_stn_info_col_header(std::ostream &os, const std::string &stn_coord_types, const UINT16 &printStationCorrections=false)
Definition dnaioadj.cpp:44
void print_adj_stn_block_header(std::ostream &os, const UINT32 &block)
Definition dnaioadj.cpp:38
void SortStationsbyID(vUINT32 &v_blockStations)
void SortStationsbyFileOrder(vUINT32 &v_blockStations)
void PrintAdjStation(std::ostream &os, const UINT32 &block, const UINT32 &stn, const UINT32 &mat_idx, const matrix_2d *stationEstimates, matrix_2d *stationVariances, bool recomputeGeographicCoords, bool updateGeographicCoords, bool reapplyTypeBUncertainties)

References Phased_Block_1Mode, PhasedMode, dynadjust::iostreams::dna_io_adj::print_adj_stn_block_header(), dynadjust::iostreams::dna_io_adj::print_adj_stn_header(), dynadjust::iostreams::dna_io_adj::print_stn_info_col_header(), PrintAdjStation(), projectSettings_, dynadjust::math::matrix_2d::rows(), SignalExceptionAdjustment(), SimultaneousMode, SortStationsbyFileOrder(), SortStationsbyID(), v_blockStationsMap_, and v_parameterStationList_.

Referenced by AdjustSimultaneous(), CarryForwardJunctions(), fillSinexExample(), PrintAdjustedNetworkStations(), UpdateEstimatesFinal(), and UpdateEstimatesReverse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAdjStationsUniqueList()

void dynadjust::networkadjust::dna_adjust::PrintAdjStationsUniqueList ( std::ostream & os,
const v_mat_2d * stationEstimates,
v_mat_2d * stationVariances,
bool recomputeGeographicCoords,
bool updateGeographicCoords,
bool reapplyTypeBUncertainties )
private

Definition at line 9897 of file dnaadjust.cpp.

9901{
9902 try {
9903 // Print header info and columns to adj file. Throws runtime_error on failure.
9904 dna_io_adj adj;
9905 adj.print_adj_stn_header(os);
9907 projectSettings_.o._stn_coord_types, projectSettings_.o._stn_corr);
9908 }
9909 catch (const std::runtime_error& e) {
9910 SignalExceptionAdjustment(e.what(), 0);
9911 }
9912
9913 UINT32 block(UINT_MAX), stn, mat_index;
9914 _it_u32u32_uint32_pair _it_bsmu;
9915
9916 // Determine sort order of block Stations Map
9917 if (projectSettings_.a.stage || projectSettings_.a.adjust_mode == Phased_Block_1Mode)
9918 {
9919 // sort by blocks to create efficiency when deserialising matrix info
9920 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(),
9921 CompareBlockStationMapUnique_byBlock<u32u32_uint32_pair>());
9922 }
9923 else if (projectSettings_.o._sort_stn_file_order)
9924 {
9925 CompareBlockStationMapUnique_byFileOrder<station_t, u32u32_uint32_pair> stnorderCompareFunc(&bstBinaryRecords_);
9926 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(), stnorderCompareFunc);
9927 }
9928 else
9929 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end());
9930
9931 std::stringstream stationRecord;
9932 v_uint32_string_pair stationsOutput;
9933 stationsOutput.reserve(v_blockStationsMapUnique_.size());
9934
9935 std::ostream* outstream(&os);
9936 if (projectSettings_.a.stage)
9937 outstream = &stationRecord;
9938
9939 // Print stations according to the user-defined sort order
9940 for (_it_bsmu=v_blockStationsMapUnique_.begin();
9941 _it_bsmu!=v_blockStationsMapUnique_.end(); ++_it_bsmu)
9942 {
9943 // If this is not the first block, exit if block-1 mode
9944 if (projectSettings_.a.adjust_mode == Phased_Block_1Mode)
9945 if (_it_bsmu->second > 0)
9946 break;
9947
9948 if (projectSettings_.a.stage)
9949 {
9950 if (block != _it_bsmu->second)
9951 {
9952 // unload previous block
9953 if (_it_bsmu->second > 0)
9954 {
9955 UnloadBlock(_it_bsmu->second-1, 2, sf_rigorous_stns, sf_rigorous_vars);
9956
9957 // Were original station estimates updated? If so, serialise, otherwise unload
9958 if (projectSettings_.o._init_stn_corrections || projectSettings_.o._stn_corr)
9959 SerialiseBlockToMappedFile(_it_bsmu->second-1, 1,
9961 }
9962
9963 // load up this block
9964 DeserialiseBlockFromMappedFile(_it_bsmu->second, 2,
9966
9967 if (projectSettings_.o._init_stn_corrections || projectSettings_.o._stn_corr)
9968 DeserialiseBlockFromMappedFile(_it_bsmu->second, 1,
9970
9971 }
9972 }
9973
9974 block = _it_bsmu->second;
9975 stn = _it_bsmu->first.first;
9976 mat_index = _it_bsmu->first.second * 3;
9977
9978 PrintAdjStation(*outstream,
9979 block, stn, mat_index,
9980 &stationEstimates->at(block), &stationVariances->at(block),
9981 recomputeGeographicCoords, updateGeographicCoords,
9982 reapplyTypeBUncertainties);
9983
9984 if (projectSettings_.a.stage)
9985 {
9986 stationsOutput.push_back(uint32_string_pair(stn, stationRecord.str()));
9987 stationRecord.str("");
9988 }
9989 }
9990
9991 if (projectSettings_.a.stage)
9992 {
9994
9995 // Were original station estimates updated? If so, serialise, otherwise unload
9996 if (projectSettings_.o._init_stn_corrections || projectSettings_.o._stn_corr)
9999
10000 // if required, sort stations according to original station file order
10001 if (projectSettings_.o._sort_stn_file_order)
10002 {
10003 CompareOddPairFirst_FileOrder<station_t, UINT32, std::string> stnorderCompareFunc(&bstBinaryRecords_);
10004 std::sort(stationsOutput.begin(), stationsOutput.end(), stnorderCompareFunc);
10005 }
10006 else
10007 std::sort(stationsOutput.begin(), stationsOutput.end(), CompareOddPairFirst<UINT32, std::string>());
10008
10009 for_each(stationsOutput.begin(), stationsOutput.end(),
10010 [&stationsOutput, &os] (std::pair<UINT32, std::string>& adjRecord) {
10011 os << adjRecord.second;
10012 }
10013 );
10014 }
10015
10016 os << std::endl;
10017}
std::pair< UINT32, std::string > uint32_string_pair
Definition dnatypes.hpp:106
std::vector< uint32_string_pair > v_uint32_string_pair
Definition dnatypes.hpp:285

References bstBinaryRecords_, DeserialiseBlockFromMappedFile(), Phased_Block_1Mode, dynadjust::iostreams::dna_io_adj::print_adj_stn_header(), dynadjust::iostreams::dna_io_adj::print_stn_info_col_header(), PrintAdjStation(), projectSettings_, SerialiseBlockToMappedFile(), sf_original_stns, sf_rigorous_stns, sf_rigorous_vars, SignalExceptionAdjustment(), UnloadBlock(), and v_blockStationsMapUnique_.

Referenced by fillSinexExample(), and PrintAdjustedNetworkStations().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCorStations()

void dynadjust::networkadjust::dna_adjust::PrintCorStations ( std::ostream & cor_file,
const UINT32 & block )
private

Definition at line 10346 of file dnaadjust.cpp.

10347{
10348 vUINT32 v_blockStations(v_parameterStationList_.at(block));
10349
10350 // if required, sort stations according to original station file order
10351 if (projectSettings_.o._sort_stn_file_order)
10352 SortStationsbyFileOrder(v_blockStations);
10353
10354 switch (projectSettings_.a.adjust_mode)
10355 {
10356 case PhasedMode:
10357 case Phased_Block_1Mode: // only the first block is rigorous
10358 cor_file << "Block " << block + 1 << std::endl;
10359 break;
10360 }
10361
10362 cor_file << std::setw(STATION) << std::left << "Station" <<
10363 std::setw(PAD2) << " " <<
10364 std::right << std::setw(MSR) << "Azimuth" <<
10365 std::right << std::setw(MSR) << "V. Angle" <<
10366 std::right << std::setw(MSR) << "S. Distance" <<
10367 std::right << std::setw(MSR) << "H. Distance" <<
10368 std::right << std::setw(HEIGHT) << "east" <<
10369 std::right << std::setw(HEIGHT) << "north" <<
10370 std::right << std::setw(HEIGHT) << "up" << std::endl;
10371
10373
10374 for (i=0; i<j; ++i)
10375 cor_file << "-";
10376 cor_file << std::endl;
10377
10378 UINT32 mat_idx, stn;
10379
10380 pv_mat_2d estimates(&v_rigorousStations_);
10381 if (projectSettings_.a.adjust_mode == SimultaneousMode)
10382 estimates = &v_estimatedStations_;
10383
10384 // Print stations according to the user-defined sort order
10385 for (i=0; i<v_blockStationsMap_.at(block).size(); ++i)
10386 {
10387 stn = v_blockStations.at(i);
10388 mat_idx = v_blockStationsMap_.at(block)[stn] * 3;
10389
10390 PrintCorStation(cor_file, block, stn, mat_idx,
10391 &estimates->at(block));
10392 }
10393
10394 cor_file << std::endl;
10395
10396 // return sort order to alpha-numeric
10397 if (projectSettings_.o._sort_stn_file_order)
10398 SortStationsbyID(v_blockStations);
10399
10400}
void PrintCorStation(std::ostream &os, const UINT32 &block, const UINT32 &stn, const UINT32 &mat_idx, const matrix_2d *stationEstimates)
std::vector< matrix_2d > * pv_mat_2d

References HEIGHT(), MSR(), PAD2(), Phased_Block_1Mode, PhasedMode, PrintCorStation(), projectSettings_, SimultaneousMode, SortStationsbyFileOrder(), SortStationsbyID(), STATION(), v_blockStationsMap_, v_estimatedStations_, v_parameterStationList_, and v_rigorousStations_.

Referenced by fillSinexExample(), and PrintNetworkStationCorrections().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCorStationsUniqueList()

void dynadjust::networkadjust::dna_adjust::PrintCorStationsUniqueList ( std::ostream & cor_file)
private

Definition at line 10402 of file dnaadjust.cpp.

10403{
10404 vUINT32 v_blockStations;
10405 vstring stn_corr_records(bstBinaryRecords_.size());
10406
10407 cor_file << std::setw(STATION) << std::left << "Station" <<
10408 std::setw(PAD2) << " " <<
10409 std::right << std::setw(MSR) << "Azimuth" <<
10410 std::right << std::setw(MSR) << "V. Angle" <<
10411 std::right << std::setw(MSR) << "S. Distance" <<
10412 std::right << std::setw(MSR) << "H. Distance" <<
10413 std::right << std::setw(HEIGHT) << "east" <<
10414 std::right << std::setw(HEIGHT) << "north" <<
10415 std::right << std::setw(HEIGHT) << "up" << std::endl;
10416
10418
10419 for (i=0; i<j; ++i)
10420 cor_file << "-";
10421 cor_file << std::endl;
10422
10423 UINT32 block(UINT_MAX), stn, mat_index;
10424 _it_u32u32_uint32_pair _it_bsmu;
10425
10426 std::stringstream stationRecord;
10427 v_uint32_string_pair correctionsOutput;
10428 correctionsOutput.reserve(v_blockStationsMapUnique_.size());
10429
10430 pv_mat_2d estimates(&v_rigorousStations_);
10431 if (projectSettings_.a.adjust_mode == SimultaneousMode)
10432 estimates = &v_estimatedStations_;
10433
10434 std::ostream* outstream(&cor_file);
10435 if (projectSettings_.a.stage)
10436 outstream = &stationRecord;
10437
10438 // No need to sort order of block Stations Map - this was done in
10439 // PrintAdjStationsUniqueList
10440
10441 for (_it_bsmu=v_blockStationsMapUnique_.begin();
10442 _it_bsmu!=v_blockStationsMapUnique_.end(); ++_it_bsmu)
10443 {
10444 // If this is not the first block, exit if block-1 mode
10445 if (projectSettings_.a.adjust_mode == Phased_Block_1Mode)
10446 if (_it_bsmu->second > 0)
10447 break;
10448
10449 if (projectSettings_.a.stage)
10450 {
10451 if (block != _it_bsmu->second)
10452 {
10453 // unload previous block
10454 if (_it_bsmu->second > 0)
10455 UnloadBlock(_it_bsmu->second-1, 2,
10457
10458 // load up this block
10459 if (projectSettings_.a.stage)
10460 DeserialiseBlockFromMappedFile(_it_bsmu->second, 2,
10462 }
10463 }
10464
10465 block = _it_bsmu->second;
10466 stn = _it_bsmu->first.first;
10467 mat_index = _it_bsmu->first.second * 3;
10468
10469 PrintCorStation(*outstream, block, stn, mat_index,
10470 &estimates->at(block));
10471
10472 if (projectSettings_.a.stage)
10473 {
10474 correctionsOutput.push_back(uint32_string_pair(stn, stationRecord.str()));
10475 stationRecord.str("");
10476 }
10477 }
10478
10479 if (projectSettings_.a.stage)
10480 UnloadBlock(block, 2,
10482
10483 // if required, sort stations according to original station file order
10484 if (projectSettings_.o._sort_stn_file_order)
10485 {
10486 CompareOddPairFirst_FileOrder<station_t, UINT32, std::string> stnorderCompareFunc(&bstBinaryRecords_);
10487 std::sort(correctionsOutput.begin(), correctionsOutput.end(), stnorderCompareFunc);
10488 }
10489 else
10490 std::sort(correctionsOutput.begin(), correctionsOutput.end(), CompareOddPairFirst<UINT32, std::string>());
10491
10492 for_each(correctionsOutput.begin(), correctionsOutput.end(),
10493 [&correctionsOutput, &cor_file] (std::pair<UINT32, std::string>& corrRecord) {
10494 cor_file << corrRecord.second;
10495 }
10496 );
10497}

References bstBinaryRecords_, DeserialiseBlockFromMappedFile(), HEIGHT(), MSR(), PAD2(), Phased_Block_1Mode, PrintCorStation(), projectSettings_, sf_original_stns, sf_rigorous_stns, SimultaneousMode, STATION(), UnloadBlock(), v_blockStationsMapUnique_, v_estimatedStations_, and v_rigorousStations_.

Referenced by fillSinexExample(), and PrintNetworkStationCorrections().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintCorStation()

void dynadjust::networkadjust::dna_adjust::PrintCorStation ( std::ostream & os,
const UINT32 & block,
const UINT32 & stn,
const UINT32 & mat_idx,
const matrix_2d * stationEstimates )
private

Definition at line 9505 of file dnaadjust.cpp.

9508{
9509 double vertical_angle, azimuth, slope_distance, horiz_distance,
9510 local_12e, local_12n, local_12up;
9511
9512 // calculate vertical angle
9513 vertical_angle = VerticalAngle(
9514 v_originalStations_.at(block).get(mat_index, 0), // X1
9515 v_originalStations_.at(block).get(mat_index+1, 0), // Y1
9516 v_originalStations_.at(block).get(mat_index+2, 0), // Z1
9517 stationEstimates->get(mat_index, 0), // X2
9518 stationEstimates->get(mat_index+1, 0), // Y2
9519 stationEstimates->get(mat_index+2, 0), // Z2
9520 bstBinaryRecords_.at(stn).currentLatitude,
9521 bstBinaryRecords_.at(stn).currentLongitude,
9522 bstBinaryRecords_.at(stn).currentLatitude,
9523 bstBinaryRecords_.at(stn).currentLongitude,
9524 0., 0.,
9525 &local_12e, &local_12n, &local_12up);
9526
9527 if (fabs(local_12e) < PRECISION_1E5)
9528 if (fabs(local_12n) < PRECISION_1E5)
9529 if (fabs(local_12up) < PRECISION_1E5)
9530 vertical_angle = 0.;
9531
9532 // Is the vertical correction within the user-specified tolerance?
9533 if (fabs(local_12up) < projectSettings_.o._vt_corr_threshold)
9534 return;
9535
9536 // compute horizontal correction
9537 horiz_distance = magnitude(local_12e, local_12n);
9538
9539 // Is the horizontal correction within the user-specified tolerance?
9540 if (horiz_distance < projectSettings_.o._hz_corr_threshold)
9541 return;
9542
9543 // calculate azimuth
9544 azimuth = Direction(
9545 v_originalStations_.at(block).get(mat_index, 0), // X1
9546 v_originalStations_.at(block).get(mat_index+1, 0), // Y1
9547 v_originalStations_.at(block).get(mat_index+2, 0), // Z1
9548 stationEstimates->get(mat_index, 0), // X2
9549 stationEstimates->get(mat_index+1, 0), // Y2
9550 stationEstimates->get(mat_index+2, 0), // Z2
9551 bstBinaryRecords_.at(stn).currentLatitude,
9552 bstBinaryRecords_.at(stn).currentLongitude,
9553 &local_12e, &local_12n);
9554
9555 if (fabs(local_12e) < PRECISION_1E5)
9556 if (fabs(local_12n) < PRECISION_1E5)
9557 azimuth = 0.;
9558
9559 // calculate distances
9560 slope_distance = magnitude(
9561 v_originalStations_.at(block).get(mat_index, 0), // X1
9562 v_originalStations_.at(block).get(mat_index+1, 0), // Y1
9563 v_originalStations_.at(block).get(mat_index+2, 0), // Z1
9564 stationEstimates->get(mat_index, 0), // X2
9565 stationEstimates->get(mat_index+1, 0), // Y2
9566 stationEstimates->get(mat_index+2, 0)); // Z2
9567
9568 // print...
9569 // station and constraint
9570 os << std::setw(STATION) << std::left << bstBinaryRecords_.at(stn).stationName << std::setw(PAD2) << " ";
9571 // data
9572 os << std::setw(MSR) << std::right << FormatDmsString(RadtoDms(azimuth), 4, true, false) <<
9573 std::setw(MSR) << std::right << FormatDmsString(RadtoDms(vertical_angle), 4, true, false) <<
9574 std::setw(MSR) << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << slope_distance <<
9575 std::setw(MSR) << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << horiz_distance;
9576
9578 os <<
9579 StringFromTW(local_12e, HEIGHT, PRECISION_MTR_STN) <<
9580 StringFromTW(local_12n, HEIGHT, PRECISION_MTR_STN) <<
9581 StringFromTW(local_12up, HEIGHT, PRECISION_MTR_STN) << std::endl;
9582 else
9583 os <<
9584 std::setw(HEIGHT) << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << local_12e <<
9585 std::setw(HEIGHT) << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << local_12n <<
9586 std::setw(HEIGHT) << std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << local_12up << std::endl;
9587}

References bstBinaryRecords_, Direction(), FormatDmsString(), dynadjust::math::matrix_2d::get(), HEIGHT(), isAdjustmentQuestionable_, magnitude(), MSR(), PAD2(), PRECISION_1E5(), PRECISION_MTR_STN, projectSettings_, RadtoDms(), STATION(), StringFromTW(), v_originalStations_, and VerticalAngle().

Referenced by fillSinexExample(), PrintCorStations(), and PrintCorStationsUniqueList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintPosUncertainty()

void dynadjust::networkadjust::dna_adjust::PrintPosUncertainty ( std::ostream & os,
const UINT32 & block,
const UINT32 & stn,
const UINT32 & mat_idx,
const matrix_2d * stationVariances,
const UINT32 & map_idx = 0,
const vUINT32 * blockStations = NULL )
private

Definition at line 10159 of file dnaadjust.cpp.

10161{
10162 double semimajor, semiminor, azimuth, hzPosU, vtPosU;
10163 UINT32 ic, jc;
10164
10165 matrix_2d variances_cart(3, 3), variances_local(3, 3), mrotations(3, 3);
10166 matrix_2d *variances(&variances_cart);
10167
10168 switch (projectSettings_.o._apu_vcv_units)
10169 {
10170 case ENU_apu_ui:
10171 variances = &variances_local;
10172 break;
10173 }
10174
10175 // get cartesian matrix
10176 stationVariances->submatrix(mat_idx, mat_idx, &variances_cart, 3, 3);
10177
10178 // Calculate standard deviations in local reference frame
10179 PropagateVariances_LocalCart<double>(variances_cart, variances_local,
10180 bstBinaryRecords_.at(stn).currentLatitude,
10181 bstBinaryRecords_.at(stn).currentLongitude, false,
10182 mrotations, true);
10183
10184 // Compute error ellipse terms
10185 ErrorEllipseParameters<double>(variances_local, semimajor, semiminor, azimuth);
10186
10187 // Compute positional uncertainty terms
10188 PositionalUncertainty<double>(semimajor, semiminor, sqrt(variances_local.get(2, 2)), hzPosU, vtPosU);
10189
10190 // print...
10191 // station and padding
10192 os << std::setw(STATION) << std::left << bstBinaryRecords_.at(stn).stationName << std::setw(PAD2) << " ";
10193
10194 os.flags(std::ios::fixed | std::ios::right);
10195
10196 // latitude
10197 if (projectSettings_.o._angular_type_stn == DMS)
10198 os << std::setprecision(4+PRECISION_SEC_STN) << std::setw(LAT_EAST) <<
10199 RadtoDms(bstBinaryRecords_.at(stn).currentLatitude);
10200 else
10201 os << std::setprecision(4 + PRECISION_SEC_STN) << std::setw(LAT_EAST) <<
10202 Degrees(bstBinaryRecords_.at(stn).currentLatitude);
10203 // longitude
10204 if (projectSettings_.o._angular_type_stn == DMS)
10205 os << std::setprecision(4+PRECISION_SEC_STN) << std::setw(LON_NORTH) <<
10206 RadtoDmsL(bstBinaryRecords_.at(stn).currentLongitude);
10207 else
10208 os << std::setprecision(4 + PRECISION_SEC_STN) << std::setw(LON_NORTH) <<
10209 DegreesL(bstBinaryRecords_.at(stn).currentLongitude);
10210
10211 // positional uncertainty
10213 os <<
10216 else
10217 os << std::setprecision(PRECISION_MTR_STN) << std::setw(STAT) << hzPosU <<
10218 std::setprecision(PRECISION_MTR_STN) << std::fixed << std::right << std::setw(STAT) << vtPosU;
10219
10220 // error ellipse semi-major, semi-minor, orientation
10221 os << std::setprecision(PRECISION_MTR_STN) << std::setw(PREC) << semimajor <<
10222 std::setprecision(PRECISION_MTR_STN) << std::setw(PREC) << semiminor <<
10223 std::setprecision(4) << std::setw(PREC) << RadtoDms(azimuth);
10224
10225 os.flags(std::ios::scientific | std::ios::right);
10226
10227 UINT16 PRECISION_UNCERTAINTY(9);
10228
10229 // xx, xy, xz
10231 os <<
10232 StringFromTW(variances->get(0, 0), MSR, PRECISION_UNCERTAINTY) << // e
10233 StringFromTW(variances->get(0, 1), MSR, PRECISION_UNCERTAINTY) << // n
10234 StringFromTW(variances->get(0, 2), MSR, PRECISION_UNCERTAINTY) << std::endl; // up
10235 else
10236 os <<
10237 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(0, 0) << // e
10238 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(0, 1) << // n
10239 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(0, 2) << std::endl; // up
10240
10241 // Next line: yy, yz
10242 os << std::setw(STATION+PAD2+LAT_EAST+LON_NORTH+STAT+STAT+PREC+PREC+PREC+MSR) << " "; // padding
10244 os <<
10245 StringFromTW(variances->get(1, 1), MSR, PRECISION_UNCERTAINTY) << // n
10246 StringFromTW(variances->get(1, 2), MSR, PRECISION_UNCERTAINTY) << std::endl; // up
10247 else
10248 os <<
10249 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(1, 1) << // n
10250 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(1, 2) << std::endl; // up
10251
10252 // Next line: zz
10253 os << std::setw(STATION+PAD2+LAT_EAST+LON_NORTH+STAT+STAT+PREC+PREC+PREC+MSR+MSR) << " "; // padding
10255 os <<
10256 StringFromTW(variances->get(2, 2), MSR, PRECISION_UNCERTAINTY) << std::endl; // up
10257 else
10258 os <<
10259 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(2, 2) << std::endl; // up
10260
10261 if (!projectSettings_.o._output_pu_covariances)
10262 return;
10263
10264 // Print covariances
10265 for (ic=map_idx+1; ic<v_blockStationsMap_.at(block).size(); ++ic)
10266 {
10267 jc = v_blockStationsMap_.at(block)[blockStations->at(ic)] * 3;
10268
10269 // get cartesian submatrix corresponding to the covariance
10270 stationVariances->submatrix(mat_idx, jc, &variances_cart, 3, 3);
10271
10272 switch (projectSettings_.o._apu_vcv_units)
10273 {
10274 case ENU_apu_ui:
10275 // Calculate vcv in local reference frame
10276 PropagateVariances_LocalCart<double>(variances_cart, variances_local,
10277 bstBinaryRecords_.at(stn).currentLatitude,
10278 bstBinaryRecords_.at(stn).currentLongitude, false,
10279 mrotations, false);
10280 break;
10281 }
10282
10283 os << std::setw(STATION) << std::left << bstBinaryRecords_.at(blockStations->at(ic)).stationName;
10284
10285 os.flags(std::ios::scientific | std::ios::right);
10286 os <<
10287 std::setw(PAD2+LAT_EAST+LON_NORTH+STAT+STAT+PREC+PREC+PREC) << " " << // padding
10288 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(0, 0) << // 11
10289 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(0, 1) << // 12
10290 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(0, 2) << std::endl; // 13
10291
10292 os <<
10293 std::setw(STATION+PAD2+LAT_EAST+LON_NORTH+STAT+STAT+PREC+PREC+PREC) << " " << // padding
10294 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(1, 0) << // 21
10295 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(1, 1) << // 22
10296 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(1, 2) << std::endl; // 23
10297
10298 os <<
10299 std::setw(STATION+PAD2+LAT_EAST+LON_NORTH+STAT+STAT+PREC+PREC+PREC) << " " << // padding
10300 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(2, 0) << // 31
10301 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(2, 1) << // 32
10302 std::setprecision(PRECISION_UNCERTAINTY) << std::setw(MSR) << variances->get(2, 2) << std::endl; // 33
10303 }
10304}
void PositionalUncertainty(const T &semimajor, const T &semiminor, const T &sdHt, T &hzPosU_Radius, T &vtPosU_Radius)
void ErrorEllipseParameters(const matrix_2d &mvariance, T &semimajor, T &semiminor, T &azimuth)

References bstBinaryRecords_, Degrees(), DegreesL(), DMS, ENU_apu_ui, ErrorEllipseParameters(), dynadjust::math::matrix_2d::get(), isAdjustmentQuestionable_, LAT_EAST(), LON_NORTH(), MSR(), PAD2(), PositionalUncertainty(), PREC(), PRECISION_MTR_STN, PRECISION_SEC_STN, projectSettings_, PropagateVariances_LocalCart(), RadtoDms(), RadtoDmsL(), STAT(), STATION(), StringFromTW(), dynadjust::math::matrix_2d::submatrix(), and v_blockStationsMap_.

Referenced by fillSinexExample(), PrintPosUncertainties(), and PrintPosUncertaintiesUniqueList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintPosUncertainties()

void dynadjust::networkadjust::dna_adjust::PrintPosUncertainties ( std::ostream & os,
const UINT32 & block,
const matrix_2d * stationVariances )
private

Definition at line 10306 of file dnaadjust.cpp.

10307{
10308 vUINT32 v_blockStations(v_parameterStationList_.at(block));
10309
10310 // if required, sort stations according to original station file order
10311 if (projectSettings_.o._sort_stn_file_order)
10312 SortStationsbyFileOrder(v_blockStations);
10313
10314 switch (projectSettings_.a.adjust_mode)
10315 {
10316 case PhasedMode:
10317 case Phased_Block_1Mode: // only the first block is rigorous
10318 os << "Block " << block + 1 << std::endl;
10319 break;
10320 }
10321
10322 // Print header
10324
10325 UINT32 mat_idx, stn;
10326
10327 // Print stations according to the user-defined sort order
10328 for (UINT32 i=0; i<v_blockStationsMap_.at(block).size(); ++i)
10329 {
10330 stn = v_blockStations.at(i);
10331 mat_idx = v_blockStationsMap_.at(block)[stn] * 3;
10332
10333 PrintPosUncertainty(os, //'\0',
10334 block, stn, mat_idx,
10335 stationVariances, i, &v_blockStations);
10336 }
10337
10338 os << std::endl;
10339
10340 // return sort order to alpha-numeric
10341 if (projectSettings_.o._sort_stn_file_order)
10342 SortStationsbyID(v_blockStations);
10343}
void PrintPosUncertaintiesHeader(std::ostream &os)
void PrintPosUncertainty(std::ostream &os, const UINT32 &block, const UINT32 &stn, const UINT32 &mat_idx, const matrix_2d *stationVariances, const UINT32 &map_idx=0, const vUINT32 *blockStations=NULL)

References Phased_Block_1Mode, PhasedMode, PrintPosUncertaintiesHeader(), PrintPosUncertainty(), projectSettings_, SortStationsbyFileOrder(), SortStationsbyID(), v_blockStationsMap_, and v_parameterStationList_.

Referenced by fillSinexExample(), and PrintPositionalUncertainty().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintPosUncertaintiesUniqueList()

void dynadjust::networkadjust::dna_adjust::PrintPosUncertaintiesUniqueList ( std::ostream & os,
const v_mat_2d * stationVariances )
private

Definition at line 10068 of file dnaadjust.cpp.

10069{
10070 // Print header
10072
10073 UINT32 block(UINT_MAX), stn, mat_index;
10074 _it_u32u32_uint32_pair _it_bsmu;
10075
10076 // Determine sort order of block Stations Map
10077 if (projectSettings_.a.stage || projectSettings_.a.adjust_mode == Phased_Block_1Mode)
10078 {
10079 // sort by blocks to create efficiency when deserialising matrix info
10080 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(),
10081 CompareBlockStationMapUnique_byBlock<u32u32_uint32_pair>());
10082 }
10083 else if (projectSettings_.o._sort_stn_file_order)
10084 {
10085 CompareBlockStationMapUnique_byFileOrder<station_t, u32u32_uint32_pair> stnorderCompareFunc(&bstBinaryRecords_);
10086 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end(), stnorderCompareFunc);
10087 }
10088 else
10089 std::sort(v_blockStationsMapUnique_.begin(), v_blockStationsMapUnique_.end());
10090
10091 std::stringstream stationRecord;
10092 v_uint32_string_pair stationsOutput;
10093 stationsOutput.reserve(v_blockStationsMapUnique_.size());
10094
10095 std::ostream* outstream(&os);
10096 if (projectSettings_.a.stage)
10097 outstream = &stationRecord;
10098
10099 // Print stations according to the user-defined sort order
10100 for (_it_bsmu=v_blockStationsMapUnique_.begin();
10101 _it_bsmu!=v_blockStationsMapUnique_.end(); ++_it_bsmu)
10102 {
10103 // If this is not the first block, exit if block-1 mode
10104 if (projectSettings_.a.adjust_mode == Phased_Block_1Mode)
10105 if (_it_bsmu->second > 0)
10106 break;
10107
10108 if (projectSettings_.a.stage)
10109 {
10110 if (block != _it_bsmu->second)
10111 {
10112 // unload previous block
10113 if (_it_bsmu->second > 0)
10114 UnloadBlock(_it_bsmu->second-1, 1,
10116 // load up this block
10117 if (projectSettings_.a.stage)
10118 DeserialiseBlockFromMappedFile(_it_bsmu->second, 1,
10120 }
10121 }
10122
10123 block = _it_bsmu->second;
10124 stn = _it_bsmu->first.first;
10125 mat_index = _it_bsmu->first.second * 3;
10126
10127 PrintPosUncertainty(*outstream,
10128 block, stn, mat_index,
10129 &stationVariances->at(block));
10130
10131 if (projectSettings_.a.stage)
10132 {
10133 stationsOutput.push_back(uint32_string_pair(stn, stationRecord.str()));
10134 stationRecord.str("");
10135 }
10136 }
10137
10138 if (projectSettings_.a.stage)
10139 {
10140 UnloadBlock(block, 1, sf_rigorous_vars);
10141
10142 // if required, sort stations according to original station file order
10143 if (projectSettings_.o._sort_stn_file_order)
10144 {
10145 CompareOddPairFirst_FileOrder<station_t, UINT32, std::string> stnorderCompareFunc(&bstBinaryRecords_);
10146 std::sort(stationsOutput.begin(), stationsOutput.end(), stnorderCompareFunc);
10147 }
10148 else
10149 std::sort(stationsOutput.begin(), stationsOutput.end(), CompareOddPairFirst<UINT32, std::string>());
10150
10151 for_each(stationsOutput.begin(), stationsOutput.end(),
10152 [&stationsOutput, &os] (std::pair<UINT32, std::string>& posRecord) {
10153 os << posRecord.second;
10154 }
10155 );
10156 }
10157}

References bstBinaryRecords_, DeserialiseBlockFromMappedFile(), Phased_Block_1Mode, PrintPosUncertaintiesHeader(), PrintPosUncertainty(), projectSettings_, sf_rigorous_vars, UnloadBlock(), and v_blockStationsMapUnique_.

Referenced by fillSinexExample(), and PrintPositionalUncertainty().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintPosUncertaintiesHeader()

void dynadjust::networkadjust::dna_adjust::PrintPosUncertaintiesHeader ( std::ostream & os)
private

Definition at line 10031 of file dnaadjust.cpp.

10032{
10033 os << std::setw(STATION) << std::left << "Station" <<
10034 std::setw(PAD2) << " " <<
10035 std::right << std::setw(LAT_EAST) << CDnaStation::CoordinateName('P') <<
10036 std::right << std::setw(LON_NORTH) << CDnaStation::CoordinateName('L') <<
10037 std::right << std::setw(STAT) << "Hz PosU" <<
10038 std::right << std::setw(STAT) << "Vt PosU" <<
10039 std::right << std::setw(PREC) << "Semi-major" <<
10040 std::right << std::setw(PREC) << "Semi-minor" <<
10041 std::right << std::setw(PREC) << "Orientation";
10042
10043 switch (projectSettings_.o._apu_vcv_units)
10044 {
10045 case ENU_apu_ui:
10046 os <<
10047 std::right << std::setw(MSR) << "Variance(e)" <<
10048 std::right << std::setw(MSR) << "Variance(n)" <<
10049 std::right << std::setw(MSR) << "Variance(up)" << std::endl;
10050 break;
10051 case XYZ_apu_ui:
10052 default:
10053 os <<
10054 std::right << std::setw(MSR) << "Variance(X)" <<
10055 std::right << std::setw(MSR) << "Variance(Y)" <<
10056 std::right << std::setw(MSR) << "Variance(Z)" << std::endl;
10057 break;
10058 }
10059
10061
10062 for (i=0; i<j; ++i)
10063 os << "-";
10064 os << std::endl;
10065}
static std::string CoordinateName(const char &c)

References dynadjust::measurements::CDnaStation::CoordinateName(), ENU_apu_ui, LAT_EAST(), LON_NORTH(), MSR(), PAD2(), PREC(), projectSettings_, STAT(), STATION(), and XYZ_apu_ui.

Referenced by fillSinexExample(), PrintPosUncertainties(), and PrintPosUncertaintiesUniqueList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateGeographicCoordsPhased()

void dynadjust::networkadjust::dna_adjust::UpdateGeographicCoordsPhased ( const UINT32 & block,
matrix_2d * estimatedStations )
private

Definition at line 10500 of file dnaadjust.cpp.

10501{
10502 UINT32 i(0), j(0);
10503 vUINT32 v_blockStations(v_parameterStationList_.at(block));
10504 it_vstn_appear _it_appear(v_paramStnAppearance_.at(block).begin());
10505
10506 for (j=0, i=0; i<estimatedStations->rows(); j++, i+=3, ++_it_appear)
10507 {
10508 // The same station may appear in several blocks. So, only
10509 // update (once) when this is the first time this station
10510 // appears
10511 if (!_it_appear->first_appearance_fwd)
10512 continue;
10513
10514 CartToGeo<double>(estimatedStations->get(i, 0), estimatedStations->get(i+1, 0), estimatedStations->get(i+2, 0),
10515 &(bstBinaryRecords_.at(v_blockStations.at(j)).currentLatitude),
10516 &(bstBinaryRecords_.at(v_blockStations.at(j)).currentLongitude),
10517 &(bstBinaryRecords_.at(v_blockStations.at(j)).currentHeight),
10518 datum_.GetEllipsoidRef());
10519 }
10520}

References bstBinaryRecords_, CartToGeo(), datum_, dynadjust::math::matrix_2d::get(), dynadjust::math::matrix_2d::rows(), v_parameterStationList_, and v_paramStnAppearance_.

Referenced by fillSinexExample(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UpdateGeographicCoords()

void dynadjust::networkadjust::dna_adjust::UpdateGeographicCoords ( )
private

Definition at line 10523 of file dnaadjust.cpp.

10524{
10525 it_vUINT32 _it_stn;
10526 UINT32 stn(0);
10527
10528 // all stations in simultaneous mode are kept in ISL
10529 for (_it_stn=v_ISL_.at(0).begin(); _it_stn!=v_ISL_.at(0).end(); ++_it_stn, stn+=3)
10530 {
10531 CartToGeo<double>(v_estimatedStations_.at(0).get(stn, 0), v_estimatedStations_.at(0).get(stn+1, 0), v_estimatedStations_.at(0).get(stn+2, 0),
10532 &(bstBinaryRecords_.at(*_it_stn).currentLatitude),
10533 &(bstBinaryRecords_.at(*_it_stn).currentLongitude),
10534 &(bstBinaryRecords_.at(*_it_stn).currentHeight),
10535 datum_.GetEllipsoidRef());
10536 }
10537}

References bstBinaryRecords_, CartToGeo(), datum_, v_estimatedStations_, and v_ISL_.

Referenced by fillSinexExample(), and UpdateAdjustment().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetBlkMatrixElemStn1()

◆ GetBlkMatrixElemStn2()

◆ GetBlkMatrixElemStn3()

UINT32 dynadjust::networkadjust::dna_adjust::GetBlkMatrixElemStn3 ( const UINT32 & block,
const pit_vmsr_t _it_msr )
inlineprivate

Definition at line 1067 of file dnaadjust.hpp.

1067 {
1068 return v_blockStationsMap_.at(block)[(*_it_msr)->station3] * 3;
1069 }

References v_blockStationsMap_.

Referenced by ComputePrecisionAdjMsrs(), UpdateDesignNormalMeasMatrices_A(), UpdateIgnoredMeasurements_A(), and UpdateNormals().

Here is the caller graph for this function:

◆ debug_BlockInformation()

void dynadjust::networkadjust::dna_adjust::debug_BlockInformation ( const UINT32 & currentBlock,
const std::string & adjustment_method )
private

Definition at line 4388 of file dnaadjust.cpp.

4389{
4390 if (projectSettings_.g.verbose > 3)
4391 {
4392 it_vUINT32 _it_stn;
4393 for (UINT32 i=0; i<v_parameterStationList_.at(currentBlock).size(); ++i)
4394 {
4395 debug_file << bstBinaryRecords_.at(v_parameterStationList_.at(currentBlock).at(i)).stationName;
4396 if ((_it_stn = find(v_ISL_.at(currentBlock).begin(), v_ISL_.at(currentBlock).end(), v_parameterStationList_.at(currentBlock).at(i))) != v_ISL_.at(currentBlock).end())
4397 debug_file << "i ";
4398 else if ((_it_stn = find(v_JSL_.at(currentBlock).begin(), v_JSL_.at(currentBlock).end(), v_parameterStationList_.at(currentBlock).at(i))) != v_JSL_.at(currentBlock).end())
4399 debug_file << "j ";
4400 else
4401 debug_file << " ";
4402 }
4403 debug_file << std::endl;
4404
4405 debug_file << "Block " << currentBlock + 1 << " " << adjustment_method << std::endl;
4406 debug_file << "Adjustment Estimates " << std::fixed << std::setprecision(16) << v_estimatedStations_.at(currentBlock);
4407 }
4408}

References bstBinaryRecords_, debug_file, projectSettings_, v_estimatedStations_, v_ISL_, v_JSL_, and v_parameterStationList_.

Referenced by AdjustPhasedForward(), AdjustPhasedReverse(), and AdjustPhasedReverseCombine().

Here is the caller graph for this function:

◆ debug_SolutionInformation()

void dynadjust::networkadjust::dna_adjust::debug_SolutionInformation ( const UINT32 & currentBlock)
private

Definition at line 4350 of file dnaadjust.cpp.

4351{
4352 if (projectSettings_.g.verbose > 0)
4353 {
4354 debug_file << "Block " << currentBlock + 1;
4355 if (projectSettings_.a.adjust_mode != SimultaneousMode)
4356 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
4357 debug_file << std::endl;
4358 debug_file << "Pre-adjustment Estimates " << std::fixed << std::setprecision(16) << v_estimatedStations_.at(currentBlock);
4359
4360 debug_file << "Block " << currentBlock + 1;
4361 if (projectSettings_.a.adjust_mode != SimultaneousMode)
4362 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
4363 debug_file << std::endl;
4364 debug_file << "Design " << std::fixed << std::setprecision(16) << v_design_.at(currentBlock);
4365
4366 debug_file << "Block " << currentBlock + 1;
4367 if (projectSettings_.a.adjust_mode != SimultaneousMode)
4368 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
4369 debug_file << std::endl;
4370 debug_file << "Measurements " << std::fixed << std::setprecision(16) << v_measMinusComp_.at(currentBlock);
4371
4372 debug_file << "Block " << currentBlock + 1;
4373 if (projectSettings_.a.adjust_mode != SimultaneousMode)
4374 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
4375 debug_file << std::endl;
4376 debug_file << "At * V-inv " << std::fixed << std::setprecision(16) << v_AtVinv_.at(currentBlock) << std::endl;
4377
4378 debug_file << "Block " << currentBlock + 1;
4379 if (projectSettings_.a.adjust_mode != SimultaneousMode)
4380 debug_file << (forward_ ? " (Forward)" : " (Reverse)");
4381 debug_file << std::endl;
4382 debug_file << "Normals " << std::fixed << std::setprecision(16) << v_normals_.at(currentBlock) << std::endl;
4383 debug_file.flush();
4384 }
4385}

References debug_file, forward_, projectSettings_, SimultaneousMode, v_AtVinv_, v_design_, v_estimatedStations_, v_measMinusComp_, and v_normals_.

Referenced by Solve(), and SolveTry().

Here is the caller graph for this function:

◆ BuildUniqueBlockStationMap()

void dynadjust::networkadjust::dna_adjust::BuildUniqueBlockStationMap ( )
private

Definition at line 2028 of file dnaadjust.cpp.

2029{
2031 it_vvstn_appear _it_va(v_paramStnAppearance_.begin());
2032 it_vstn_appear _it_a;
2033
2036
2037 // for each block
2038 for (_it_vm=v_blockStationsMap_.begin(), _it_va=v_paramStnAppearance_.begin();
2039 _it_vm!=v_blockStationsMap_.end();
2040 ++_it_vm, ++_it_va)
2041 {
2042 // for each station
2043 for (_it_m=_it_vm->begin(), _it_a=_it_va->begin();
2044 _it_m!=_it_vm->end();
2045 ++_it_m, ++_it_a)
2046 {
2047 if (_it_a->first_appearance_fwd)
2048 {
2049 v_blockStationsMapUnique_.push_back(
2051 uint32_uint32_pair(_it_m->first, _it_m->second), // station, block index
2052 static_cast<UINT32>(std::distance(v_blockStationsMap_.begin(), _it_vm)))); // block
2053 }
2054 }
2055 }
2056}
vv_stn_appear::iterator it_vvstn_appear
Definition dnatypes.hpp:161
v_uint32_uint32_map::iterator it_v_uint32_uint32_map
Definition dnatypes.hpp:278
std::pair< uint32_uint32_pair, UINT32 > u32u32_uint32_pair
Definition dnatypes.hpp:112
uint32_uint32_map::iterator it_uint32_uint32_map
Definition dnatypes.hpp:276

References bstBinaryRecords_, v_blockStationsMap_, v_blockStationsMapUnique_, and v_paramStnAppearance_.

Referenced by PrepareAdjustment().

Here is the caller graph for this function:

◆ BuildSimultaneousStnAppearance()

void dynadjust::networkadjust::dna_adjust::BuildSimultaneousStnAppearance ( )
private

Definition at line 2013 of file dnaadjust.cpp.

2014{
2015 it_vstn_appear _it_appear;
2016
2017 v_paramStnAppearance_.resize(1);
2018 v_paramStnAppearance_.at(0).resize(v_blockStationsMap_.at(0).size());
2019
2020 UINT32 stn(0);
2021 for_each(v_paramStnAppearance_.at(0).begin(), v_paramStnAppearance_.at(0).end(),
2022 [&stn](stn_appear& appear) {
2023 appear.set_id(stn++);
2024 appear.first_fwd();
2025 });
2026}
stn_appearance_t< UINT32, bool > stn_appear
Definition dnatypes.hpp:157

References v_blockStationsMap_, and v_paramStnAppearance_.

Referenced by PrepareAdjustment().

Here is the caller graph for this function:

◆ OpenStageFileStreams()

void dynadjust::networkadjust::dna_adjust::OpenStageFileStreams ( const int file_count = 0,
... )
private

Definition at line 384 of file dnaadjust-stage.cpp.

385{
386 if (file_count == 0)
387 {
388 // serialise all. That is, call this function again, but with
389 // arguments for all files
395 return;
396 }
397
398 std::stringstream ss;
399 ss << projectSettings_.g.output_folder << FOLDER_SLASH << projectSettings_.g.network_name << "-";
400 std::string filePath(ss.str());
401
402 v_stageFileStreams_.clear();
403 std::string fullfilePath;
404
405 va_list vlist;
406 va_start(vlist, file_count);
407
408 try {
409
410 for (UINT16 file(0); file<file_count; ++file)
411 {
412 switch (va_arg(vlist, int))
413 {
414 case sf_normals_r:
415
416 // Normals - reverse
417 fullfilePath = filePath + "neqr.mtx";
418 v_stageFileStreams_.push_back(fullfilePath);
419 if (projectSettings_.a.recreate_stage_files)
420 file_opener(f_normalsR_, fullfilePath, std::ios::out | std::ios::binary, binary);
421 normalsR_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
422
423 break;
425
426 // Measured minus computed
427 fullfilePath = filePath + "mmc.mtx";
428 v_stageFileStreams_.push_back(fullfilePath);
429 if (projectSettings_.a.recreate_stage_files)
430 file_opener(f_measMinusComp_, fullfilePath, std::ios::out | std::ios::binary, binary);
431 measMinusComp_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
432
433 break;
435
436 // Estimated stations
437 fullfilePath = filePath + "est.mtx";
438 v_stageFileStreams_.push_back(fullfilePath);
439 if (projectSettings_.a.recreate_stage_files)
440 file_opener(f_estimatedStations_, fullfilePath, std::ios::out | std::ios::binary, binary);
441 estimatedStations_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
442
443 break;
444 case sf_original_stns:
445
446 // Original stations
447 fullfilePath = filePath + "ost.mtx";
448 v_stageFileStreams_.push_back(fullfilePath);
449 if (projectSettings_.a.recreate_stage_files)
450 file_opener(f_originalStations_, fullfilePath, std::ios::out | std::ios::binary, binary);
451 originalStations_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
452
453 break;
454 case sf_rigorous_stns:
455
456 // Rigorous stations
457 fullfilePath = filePath + "rst.mtx";
458 v_stageFileStreams_.push_back(fullfilePath);
459 if (projectSettings_.a.recreate_stage_files)
460 file_opener(f_rigorousStations_, fullfilePath, std::ios::out | std::ios::binary, binary);
461 rigorousStations_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
462
463 break;
464 case sf_junction_vars:
465
466 // Junction variances
467 fullfilePath = filePath + "jva.mtx";
468 v_stageFileStreams_.push_back(fullfilePath);
469 if (projectSettings_.a.recreate_stage_files)
470 file_opener(f_junctionVariances_, fullfilePath, std::ios::out | std::ios::binary, binary);
471 junctionVariances_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
472
473 break;
475
476 // Junction variances forward
477 fullfilePath = filePath + "jvf.mtx";
478 v_stageFileStreams_.push_back(fullfilePath);
479 if (projectSettings_.a.recreate_stage_files)
480 file_opener(f_junctionVariancesFwd_, fullfilePath, std::ios::out | std::ios::binary, binary);
481 junctionVariancesFwd_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
482
483 break;
485
486 // Junction estimates forward
487 fullfilePath = filePath + "jef.mtx";
488 v_stageFileStreams_.push_back(fullfilePath);
489 if (projectSettings_.a.recreate_stage_files)
490 file_opener(f_junctionEstimatesFwd_, fullfilePath, std::ios::out | std::ios::binary, binary);
491 junctionEstimatesFwd_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
492
493 break;
495
496 // Junction estimates reverse
497 fullfilePath = filePath + "jer.mtx";
498 v_stageFileStreams_.push_back(fullfilePath);
499 if (projectSettings_.a.recreate_stage_files)
500 file_opener(f_junctionEstimatesRev_, fullfilePath, std::ios::out | std::ios::binary, binary);
501 junctionEstimatesRev_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
502
503 break;
504 case sf_rigorous_vars:
505
506 // Rigorous variances
507 fullfilePath = filePath + "rva.mtx";
508 v_stageFileStreams_.push_back(fullfilePath);
509 if (projectSettings_.a.recreate_stage_files)
510 file_opener(f_rigorousVariances_, fullfilePath, std::ios::out | std::ios::binary, binary);
511 rigorousVariances_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
512
513 break;
514 case sf_prec_adj_msrs:
515
516 // Precision adjusted measurements
517 fullfilePath = filePath + "pam.mtx";
518 v_stageFileStreams_.push_back(fullfilePath);
519 if (projectSettings_.a.recreate_stage_files)
520 file_opener(f_precAdjMsrs_, fullfilePath, std::ios::out | std::ios::binary, binary);
521 precAdjMsrs_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
522
523 break;
524 case sf_corrections:
525
526 // Corrections
527 fullfilePath = filePath + "cor.mtx";
528 v_stageFileStreams_.push_back(fullfilePath);
529 if (projectSettings_.a.recreate_stage_files)
530 file_opener(f_corrections_, fullfilePath, std::ios::out | std::ios::binary, binary);
531 corrections_map_.setnewFilePath(fullfilePath, projectSettings_.a.purge_stage_files);
532
533 break;
534 }
535 }
536 va_end(vlist);
537 }
538 catch (const std::runtime_error& e) {
539 va_end(vlist);
540 SignalExceptionAdjustment(e.what(), 0);
541 }
542}
@ binary
Definition dnatypes.hpp:427

References binary, corrections_map_, estimatedStations_map_, f_corrections_, f_estimatedStations_, f_junctionEstimatesFwd_, f_junctionEstimatesRev_, f_junctionVariances_, f_junctionVariancesFwd_, f_measMinusComp_, f_normalsR_, f_originalStations_, f_precAdjMsrs_, f_rigorousStations_, f_rigorousVariances_, file_opener(), junctionEstimatesFwd_map_, junctionEstimatesRev_map_, junctionVariances_map_, junctionVariancesFwd_map_, measMinusComp_map_, normalsR_map_, OpenStageFileStreams(), originalStations_map_, precAdjMsrs_map_, projectSettings_, rigorousStations_map_, rigorousVariances_map_, sf_corrections, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, sf_rigorous_vars, SignalExceptionAdjustment(), and v_stageFileStreams_.

Referenced by DeSerialiseAdjustedVarianceMatrices(), OpenOutputFileStreams(), OpenStageFileStreams(), and SerialiseAdjustedVarianceMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReserveBlockMapRegions()

void dynadjust::networkadjust::dna_adjust::ReserveBlockMapRegions ( const int file_count = 0,
... )
private

Definition at line 321 of file dnaadjust-stage.cpp.

322{
323 if (file_count == 0)
324 {
325 // serialise all. That is, call this function again, but with
326 // arguments for all files
332 return;
333 }
334
335 va_list vlist;
336 va_start(vlist, file_count);
337
338 for (UINT16 file(0); file<file_count; ++file)
339 {
340 switch (va_arg(vlist, int))
341 {
342 case sf_normals_r:
343 normalsR_map_.reserveblockMapRegions(blockCount_);
344 break;
346 measMinusComp_map_.reserveblockMapRegions(blockCount_);
347 break;
349 estimatedStations_map_.reserveblockMapRegions(blockCount_);
350 break;
351 case sf_original_stns:
352 originalStations_map_.reserveblockMapRegions(blockCount_);
353 break;
354 case sf_rigorous_stns:
355 rigorousStations_map_.reserveblockMapRegions(blockCount_);
356 break;
357 case sf_junction_vars:
358 junctionVariances_map_.reserveblockMapRegions(blockCount_);
359 break;
361 junctionVariancesFwd_map_.reserveblockMapRegions(blockCount_);
362 break;
364 junctionEstimatesFwd_map_.reserveblockMapRegions(blockCount_);
365 break;
367 junctionEstimatesRev_map_.reserveblockMapRegions(blockCount_);
368 break;
369 case sf_rigorous_vars:
370 rigorousVariances_map_.reserveblockMapRegions(blockCount_);
371 break;
372 case sf_prec_adj_msrs:
373 precAdjMsrs_map_.reserveblockMapRegions(blockCount_);
374 break;
375 case sf_corrections:
376 corrections_map_.reserveblockMapRegions(blockCount_);
377 break;
378 }
379 }
380 va_end(vlist);
381}

References blockCount_, corrections_map_, estimatedStations_map_, junctionEstimatesFwd_map_, junctionEstimatesRev_map_, junctionVariances_map_, junctionVariancesFwd_map_, measMinusComp_map_, normalsR_map_, originalStations_map_, precAdjMsrs_map_, ReserveBlockMapRegions(), rigorousStations_map_, rigorousVariances_map_, sf_corrections, sf_estimated_stns, sf_junction_ests_f, sf_junction_ests_r, sf_junction_vars, sf_junction_vars_f, sf_meas_minus_comp, sf_normals_r, sf_original_stns, sf_prec_adj_msrs, sf_rigorous_stns, and sf_rigorous_vars.

Referenced by DeSerialiseAdjustedVarianceMatrices(), OpenOutputFileStreams(), ReserveBlockMapRegions(), and SerialiseAdjustedVarianceMatrices().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CloseStageFileStreams()

void dynadjust::networkadjust::dna_adjust::CloseStageFileStreams ( )
private

Definition at line 970 of file dnaadjust-stage.cpp.

971{
972 // Normals -- reverse
973 f_normalsR_.close();
974
975 // Measured minus computed
976 f_measMinusComp_.close();
977
978 // Estimated stations
979 f_estimatedStations_.close();
980
981 // Original stations
982 f_originalStations_.close();
983
984 // Rigorous stations
985 f_rigorousStations_.close();
986
987 // Junction variances
988 f_junctionVariances_.close();
989
990 // Junction variances forward
992
993 // Junction estimates forward
995
996 // Junction estimates reverse
998
999 // Rigorous variances
1000 f_rigorousVariances_.close();
1001
1002 // Precision adjusted measurements
1003 f_precAdjMsrs_.close();
1004
1005 // Corrections
1006 f_corrections_.close();
1007
1008}

References f_corrections_, f_estimatedStations_, f_junctionEstimatesFwd_, f_junctionEstimatesRev_, f_junctionVariances_, f_junctionVariancesFwd_, f_measMinusComp_, f_normalsR_, f_originalStations_, f_precAdjMsrs_, f_rigorousStations_, and f_rigorousVariances_.

Referenced by PrepareAdjustment().

Here is the caller graph for this function:

◆ LoadDatabaseId()

void dynadjust::networkadjust::dna_adjust::LoadDatabaseId ( )
private

Definition at line 2447 of file dnaadjust.cpp.

2448{
2449 if (!projectSettings_.o._database_ids)
2450 return;
2451
2453 return;
2454
2455 std::string dbid_filename = formPath<std::string>(projectSettings_.g.output_folder,
2456 projectSettings_.g.network_name, "dbid");
2457
2458 // When printing database ids, force printing adjusted measurements
2459 // as a contiguous list in original sort order. Why? To simplify
2460 // reading adj file when loading adjusted measurement info to
2461 // the database.
2462 projectSettings_.o._output_msr_blocks = 0;
2463
2464 // Do not print computed measurements
2465 //projectSettings_.o._cmp_msr_iteration = 0;
2466
2467 v_msr_db_map_.clear();
2468
2469 std::ifstream dbid_file;
2470 try {
2471 // Create geoid file. Throws runtime_error on failure.
2472 file_opener(dbid_file, dbid_filename,
2473 std::ios::in | std::ios::binary, binary);
2474 }
2475 catch (const std::runtime_error& e) {
2476 SignalExceptionAdjustment(e.what(), 0);
2477 }
2478
2479 UINT32 r, recordCount;
2481
2482 try {
2483 // get size and reserve vector size
2484 dbid_file.read(reinterpret_cast<char *>(&recordCount), sizeof(UINT32));
2485 v_msr_db_map_.reserve(recordCount);
2486
2487 UINT16 val;
2488
2489 for (r = 0; r < recordCount; r++)
2490 {
2491 // Read data
2492 dbid_file.read(reinterpret_cast<char *>(&rec.msr_id), sizeof(UINT32));
2493 dbid_file.read(reinterpret_cast<char *>(&rec.cluster_id), sizeof(UINT32));
2494 dbid_file.read(reinterpret_cast<char *>(&val), sizeof(UINT16));
2496 dbid_file.read(reinterpret_cast<char *>(&val), sizeof(UINT16));
2498
2499 // push back
2500 v_msr_db_map_.push_back(rec);
2501 }
2502
2503 dbid_file.close();
2504 databaseIDsLoaded_ = true;
2505 }
2506 catch (const std::ifstream::failure& f) {
2507 SignalExceptionAdjustment(f.what(), 0);
2508 }
2509 catch (const XMLInteropException& e) {
2511 }
2512}
T formPath(const T &folder, const T &file, const T &ext)
struct msr_database_t msr_database_id_map
T val_uint(const U &value)

References binary, msr_database_t::cluster_id, databaseIDsLoaded_, file_opener(), formPath(), msr_database_t::is_cls_id_set, msr_database_t::is_msr_id_set, msr_database_t::msr_id, projectSettings_, SignalExceptionAdjustment(), v_msr_db_map_, and val_uint().

Referenced by AdjustNetwork(), and PrintAdjustedNetworkMeasurements().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ concurrent_adj_ofstream

concurrent_ofstream<std::string> dynadjust::networkadjust::dna_adjust::concurrent_adj_ofstream

Definition at line 346 of file dnaadjust.hpp.

Referenced by ThreadSafeWritetoAdjFile(), and ThreadSafeWritetoDbgFile().

◆ isPreparing_

bool dynadjust::networkadjust::dna_adjust::isPreparing_

◆ isAdjusting_

bool dynadjust::networkadjust::dna_adjust::isAdjusting_

◆ isCombining_

bool dynadjust::networkadjust::dna_adjust::isCombining_

◆ forward_

bool dynadjust::networkadjust::dna_adjust::forward_

◆ isFirstTimeAdjustment_

bool dynadjust::networkadjust::dna_adjust::isFirstTimeAdjustment_

Definition at line 374 of file dnaadjust.hpp.

Referenced by dna_adjust(), and PrepareAdjustment().

◆ isIterationComplete_

bool dynadjust::networkadjust::dna_adjust::isIterationComplete_

◆ isAdjustmentQuestionable_

◆ blockCount_

◆ currentBlock_

UINT32 dynadjust::networkadjust::dna_adjust::currentBlock_

◆ total_time_

boost::posix_time::milliseconds dynadjust::networkadjust::dna_adjust::total_time_

Definition at line 381 of file dnaadjust.hpp.

Referenced by adjustTime(), dna_adjust(), and PrintAdjustmentTime().

◆ adjustStatus_

◆ statusMessages_

vstring dynadjust::networkadjust::dna_adjust::statusMessages_

Definition at line 383 of file dnaadjust.hpp.

Referenced by dna_adjust(), and InitialiseAdjustment().

◆ currentIteration_

UINT32 dynadjust::networkadjust::dna_adjust::currentIteration_

◆ v_blockMeta_

◆ datum_

◆ projection_

CDnaProjection dynadjust::networkadjust::dna_adjust::projection_
private

Definition at line 1076 of file dnaadjust.hpp.

Referenced by PrintAdjStation().

◆ _var_C

double dynadjust::networkadjust::dna_adjust::_var_C
private

Definition at line 1077 of file dnaadjust.hpp.

Referenced by FormConstraintStationVarianceMatrix(), and InitialiseAdjustment().

◆ _var_F

double dynadjust::networkadjust::dna_adjust::_var_F
private

Definition at line 1077 of file dnaadjust.hpp.

Referenced by FormConstraintStationVarianceMatrix(), and InitialiseAdjustment().

◆ _inv_var_cart_c

matrix_2d dynadjust::networkadjust::dna_adjust::_inv_var_cart_c
private

Definition at line 1078 of file dnaadjust.hpp.

Referenced by FormConstraintStationVarianceMatrix(), and InitialiseAdjustment().

◆ _inv_var_cart_f

matrix_2d dynadjust::networkadjust::dna_adjust::_inv_var_cart_f
private

Definition at line 1078 of file dnaadjust.hpp.

Referenced by FormConstraintStationVarianceMatrix(), and InitialiseAdjustment().

◆ projectSettings_

project_settings dynadjust::networkadjust::dna_adjust::projectSettings_
private

Definition at line 1080 of file dnaadjust.hpp.

Referenced by AddConstraintStationstoNormalsForward(), AddConstraintStationstoNormalsSimultaneous(), AddMsrtoMeasMinusComp(), AdjustNetwork(), AdjustPhased(), AdjustPhasedBlock1(), AdjustPhasedForward(), AdjustPhasedMultiThread(), AdjustPhasedReverse(), AdjustPhasedReverseCombine(), AdjustSimultaneous(), ApplyAdditionalConstraints(), CarryForwardJunctions(), CarryReverseJunctions(), CarryStnEstimatesandVariancesCombine(), CarryStnEstimatesandVariancesForward(), CarryStnEstimatesandVariancesReverse(), CloseOutputFiles(), ComputeAdjMsrBlockOnIteration(), ComputeAdjustedMsrPrecisions(), ComputeandPrintAdjMsrOnIteration(), ComputeChiSquareNetwork(), ComputeGlobalPelzer(), ComputePrecisionAdjMsrs(), ComputeStatistics(), ComputeTestStat(), ComputeTstatistics(), CreateMsrToStnTally(), debug_BlockInformation(), debug_SolutionInformation(), DeSerialiseAdjustedVarianceMatrices(), dna_adjust(), FormInverseVarianceMatrix(), FormUniqueMsrList(), GenerateStatistics(), GetMemoryFootprint(), InitialiseAdjustment(), InitialiseMeasurement(), InitialiseTypeBUncertainties(), LoadDatabaseId(), LoadNetworkFiles(), LoadSegmentationFile(), LoadSegmentationMetrics(), LoadVarianceMatrix_D(), LoadVarianceMatrix_G(), LoadVarianceMatrix_X(), LoadVarianceMatrix_Y(), LoadVarianceScaling(), OpenOutputFileStreams(), OpenStageFileStreams(), OutputLargestCorrection(), PopulateEstimatedStationMatrix(), PrepareAdjustment(), PrepareAdjustmentBlock(), PrepareAdjustmentCombine(), PrepareAdjustmentReverse(), PrepareDesignAndMsrMnsCmpMatrices(), PrepareDesignAndMsrMnsCmpMatricesStage(), PrepareMappedRegions(), PrepareStationandVarianceMatrices(), PrintAdjGNSSAlternateUnits(), PrintAdjMeasurements(), PrintAdjMeasurements_D(), PrintAdjMeasurements_GXY(), PrintAdjMeasurementsHeader(), PrintAdjMeasurementStatistics(), PrintAdjStation(), PrintAdjStations(), PrintAdjStationsUniqueList(), PrintAdjustedNetworkMeasurements(), PrintAdjustedNetworkStations(), PrintAdjustmentStatus(), PrintCompMeasurements(), PrintCompMeasurements_D(), PrintCompMeasurementsAngular(), PrintCompMeasurementsLinear(), PrintCorStation(), PrintCorStations(), PrintCorStationsUniqueList(), PrintEstimatedStationCoordinatestoDNAXML(), PrintEstimatedStationCoordinatestoDNAXML_Y(), PrintEstimatedStationCoordinatestoSNX(), PrintIteration(), PrintMeasurementsAngular(), PrintMeasurementsLinear(), PrintMeasurementsToStation(), PrintNetworkStationCorrections(), PrintOutputFileHeaderInfo(), PrintPositionalUncertainty(), PrintPosUncertainties(), PrintPosUncertaintiesHeader(), PrintPosUncertaintiesUniqueList(), PrintPosUncertainty(), PrintStatistics(), ResizeMatrixVectors(), SerialiseAdjustedVarianceMatrices(), SetDefaultReferenceFrame(), SignalExceptionAdjustment(), Solve(), SolveMT(), SolveMTTry(), UpdateAdjustment(), UpdateAtVinv(), UpdateBinaryFiles(), UpdateDesignMeasMatrices_GX(), UpdateDesignNormalMeasMatrices_A(), UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_D(), UpdateDesignNormalMeasMatrices_G(), UpdateDesignNormalMeasMatrices_H(), UpdateDesignNormalMeasMatrices_I(), UpdateDesignNormalMeasMatrices_J(), UpdateDesignNormalMeasMatrices_L(), UpdateDesignNormalMeasMatrices_S(), UpdateDesignNormalMeasMatrices_V(), UpdateDesignNormalMeasMatrices_X(), UpdateDesignNormalMeasMatrices_Y(), UpdateDesignNormalMeasMatrices_Z(), UpdateEstimatesCombine(), UpdateEstimatesFinal(), UpdateEstimatesForward(), UpdateEstimatesReverse(), UpdateIgnoredMeasurements_D(), UpdateNormals_Y(), ValidateandFinaliseAdjustment(), WriteMsrtoAdjFile(), WriteStatstoAdjFile(), and WriteStntoAdjFile().

◆ bst_meta_

binary_file_meta_t dynadjust::networkadjust::dna_adjust::bst_meta_
private

◆ bms_meta_

◆ bstBinaryRecords_

vstn_t dynadjust::networkadjust::dna_adjust::bstBinaryRecords_
private

Definition at line 1085 of file dnaadjust.hpp.

Referenced by AddConstraintStationstoNormalsForward(), AddConstraintStationstoNormalsSimultaneous(), AddDiscontinuitySites(), AddMsrtoMeasMinusComp(), ApplyAdditionalConstraints(), BuildUniqueBlockStationMap(), CarryStnEstimatesandVariancesForward(), CarryStnEstimatesandVariancesReverse(), debug_BlockInformation(), dna_adjust(), FormConstraintStationVarianceMatrix(), GetMemoryFootprint(), InitialiseAdjustment(), InitialiseTypeBUncertainties(), LoadNetworkFiles(), LoadVarianceMatrix_G(), LoadVarianceMatrix_X(), LoadVarianceMatrix_Y(), OutputLargestCorrection(), PopulateEstimatedStationMatrix(), PrepareAdjustmentBlock(), PrintAdjGNSSAlternateUnits(), PrintAdjMeasurements_A(), PrintAdjMeasurements_BKVZ(), PrintAdjMeasurements_CELMS(), PrintAdjMeasurements_D(), PrintAdjMeasurements_GXY(), PrintAdjMeasurements_HR(), PrintAdjMeasurements_IJPQ(), PrintAdjMeasurements_YLLH(), PrintAdjStation(), PrintAdjStationsUniqueList(), PrintCompMeasurements_A(), PrintCompMeasurements_BKVZ(), PrintCompMeasurements_CELMS(), PrintCompMeasurements_D(), PrintCompMeasurements_GXY(), PrintCompMeasurements_HR(), PrintCompMeasurements_IJPQ(), PrintCompMeasurements_YLLH(), PrintCorStation(), PrintCorStationsUniqueList(), PrintEstimatedStationCoordinatestoDNAXML(), PrintEstimatedStationCoordinatestoDNAXML_Y(), PrintEstimatedStationCoordinatestoSNX(), PrintMeasurementsAngular(), PrintMeasurementsLinear(), PrintMeasurementsToStation(), PrintMsrVarianceMatrixException(), PrintPosUncertaintiesUniqueList(), PrintPosUncertainty(), ReduceYLLHMeasurementsforPrinting(), Solve(), SolveMT(), SortStationsbyFileOrder(), UpdateBinaryFiles(), UpdateDesignNormalMeasMatrices_A(), UpdateDesignNormalMeasMatrices_BK(), UpdateDesignNormalMeasMatrices_CEM(), UpdateDesignNormalMeasMatrices_E(), UpdateDesignNormalMeasMatrices_H(), UpdateDesignNormalMeasMatrices_HR(), UpdateDesignNormalMeasMatrices_I(), UpdateDesignNormalMeasMatrices_J(), UpdateDesignNormalMeasMatrices_JQ(), UpdateDesignNormalMeasMatrices_L(), UpdateDesignNormalMeasMatrices_M(), UpdateDesignNormalMeasMatrices_S(), UpdateDesignNormalMeasMatrices_V(), UpdateDesignNormalMeasMatrices_Y(), UpdateDesignNormalMeasMatrices_Z(), UpdateGeographicCoords(), UpdateGeographicCoordsPhased(), UpdateIgnoredMeasurements_A(), UpdateIgnoredMeasurements_BK(), UpdateIgnoredMeasurements_CEM(), UpdateIgnoredMeasurements_E(), UpdateIgnoredMeasurements_H(), UpdateIgnoredMeasurements_HR(), UpdateIgnoredMeasurements_I(), UpdateIgnoredMeasurements_J(), UpdateIgnoredMeasurements_K(), UpdateIgnoredMeasurements_L(), UpdateIgnoredMeasurements_M(), UpdateIgnoredMeasurements_S(), UpdateIgnoredMeasurements_V(), UpdateIgnoredMeasurements_Y(), UpdateIgnoredMeasurements_Z(), UpdateMsrRecord(), and UpdateNormals_Y().

◆ bmsBinaryRecords_

◆ vAssocStnList_

◆ vAssocMsrList_

v_aml_pair dynadjust::networkadjust::dna_adjust::vAssocMsrList_
private

Definition at line 1088 of file dnaadjust.hpp.

Referenced by CreateMsrToStnTally(), dna_adjust(), and GetMemoryFootprint().

◆ bmsr_count_

UINT32 dynadjust::networkadjust::dna_adjust::bmsr_count_
private

Definition at line 1090 of file dnaadjust.hpp.

Referenced by dna_adjust(), and LoadNetworkFiles().

◆ bstn_count_

UINT32 dynadjust::networkadjust::dna_adjust::bstn_count_
private

Definition at line 1091 of file dnaadjust.hpp.

Referenced by dna_adjust(), and LoadNetworkFiles().

◆ asl_count_

UINT32 dynadjust::networkadjust::dna_adjust::asl_count_
private

Definition at line 1092 of file dnaadjust.hpp.

Referenced by dna_adjust(), and LoadNetworkFiles().

◆ debug_file

◆ adj_file

std::ofstream dynadjust::networkadjust::dna_adjust::adj_file
private

Definition at line 1095 of file dnaadjust.hpp.

Referenced by AdjustNetwork(), AdjustPhasedBlock1(), AdjustPhasedForward(), AdjustPhasedMultiThread(), AdjustPhasedReverse(), AdjustPhasedReverseCombine(), AdjustSimultaneous(), CarryForwardJunctions(), CarryStnEstimatesandVariancesCombine(), CloseOutputFiles(), ComputeTestStat(), DeSerialiseAdjustedVarianceMatrices(), InitialiseAdjustment(), LoadNetworkFiles(), OpenOutputFileStreams(), OutputLargestCorrection(), PrepareAdjustment(), PrepareAdjustmentBlock(), PrepareAdjustmentReverse(), PrepareMappedRegions(), PrintAdjMeasurements(), PrintAdjMeasurements_A(), PrintAdjMeasurements_BKVZ(), PrintAdjMeasurements_CELMS(), PrintAdjMeasurements_D(), PrintAdjMeasurements_GXY(), PrintAdjMeasurements_HR(), PrintAdjMeasurements_IJPQ(), PrintAdjMeasurements_YLLH(), PrintAdjMeasurementsHeader(), PrintAdjMeasurementStatistics(), PrintAdjustedNetworkStations(), PrintAdjustmentStatus(), PrintAdjustmentTime(), PrintCompMeasurements(), PrintCompMeasurements_A(), PrintCompMeasurements_BKVZ(), PrintCompMeasurements_CELMS(), PrintCompMeasurements_D(), PrintCompMeasurements_GXY(), PrintCompMeasurements_HR(), PrintCompMeasurements_IJPQ(), PrintCompMeasurements_YLLH(), PrintCompMeasurementsAngular(), PrintCompMeasurementsLinear(), PrintIgnoredAdjMeasurements(), PrintIteration(), PrintMeasurementCorrection(), PrintMeasurementDatabaseID(), PrintMeasurementsAngular(), PrintMeasurementsLinear(), PrintMeasurementsToStation(), PrintMsrVarianceMatrixException(), PrintOutputFileHeaderInfo(), PrintStatistics(), ResizeMatrixVectors(), ThreadSafeWritetoAdjFile(), UpdateAdjustment(), UpdateEstimatesFinal(), UpdateEstimatesReverse(), and ~dna_adjust().

◆ xyz_file

std::ofstream dynadjust::networkadjust::dna_adjust::xyz_file
private

◆ blockLargeCorr_

UINT32 dynadjust::networkadjust::dna_adjust::blockLargeCorr_
private

◆ largestCorr_

double dynadjust::networkadjust::dna_adjust::largestCorr_
private

◆ PRECISION_SEC_MSR

UINT16 dynadjust::networkadjust::dna_adjust::PRECISION_SEC_MSR
private

◆ PRECISION_SEC_STN

UINT16 dynadjust::networkadjust::dna_adjust::PRECISION_SEC_STN
private

Definition at line 1101 of file dnaadjust.hpp.

Referenced by InitialiseAdjustment(), PrintAdjStation(), and PrintPosUncertainty().

◆ PRECISION_MTR_MSR

UINT16 dynadjust::networkadjust::dna_adjust::PRECISION_MTR_MSR
private

◆ PRECISION_MTR_STN

UINT16 dynadjust::networkadjust::dna_adjust::PRECISION_MTR_STN
private

◆ measurementParams_

◆ measurementCount_

UINT32 dynadjust::networkadjust::dna_adjust::measurementCount_
private

Definition at line 1110 of file dnaadjust.hpp.

Referenced by ComputeChiSquareSimultaneous(), dna_adjust(), and LoadNetworkFiles().

◆ unknownParams_

◆ unknownsCount_

UINT32 dynadjust::networkadjust::dna_adjust::unknownsCount_
private

◆ chiSquared_

◆ chiSquaredStage_

double dynadjust::networkadjust::dna_adjust::chiSquaredStage_
private

Definition at line 1114 of file dnaadjust.hpp.

Referenced by AdjustPhased(), and AdjustPhasedReverseCombine().

◆ sigmaZero_

◆ sigmaZeroSqRt_

double dynadjust::networkadjust::dna_adjust::sigmaZeroSqRt_
private

◆ chiSquaredUpperLimit_

double dynadjust::networkadjust::dna_adjust::chiSquaredUpperLimit_
private

◆ chiSquaredLowerLimit_

double dynadjust::networkadjust::dna_adjust::chiSquaredLowerLimit_
private

◆ globalPelzerReliability_

double dynadjust::networkadjust::dna_adjust::globalPelzerReliability_
private

◆ degreesofFreedom_

int dynadjust::networkadjust::dna_adjust::degreesofFreedom_
private

◆ passFail_

UINT32 dynadjust::networkadjust::dna_adjust::passFail_
private

Definition at line 1121 of file dnaadjust.hpp.

Referenced by ComputeGlobalTestStat(), dna_adjust(), GetTestResult(), and PrintStatistics().

◆ maxCorr_

◆ criticalValue_

double dynadjust::networkadjust::dna_adjust::criticalValue_
private

◆ potentialOutlierCount_

UINT32 dynadjust::networkadjust::dna_adjust::potentialOutlierCount_
private

◆ allStationsFixed_

bool dynadjust::networkadjust::dna_adjust::allStationsFixed_
private

◆ iterationCorrections_

message_bank<std::string> dynadjust::networkadjust::dna_adjust::iterationCorrections_
private

◆ v_ContiguousNetList_

vUINT32 dynadjust::networkadjust::dna_adjust::v_ContiguousNetList_
private

◆ v_statSummary_

vsummary_t dynadjust::networkadjust::dna_adjust::v_statSummary_
private

◆ v_pseudoMeasCountFwd_

vUINT32 dynadjust::networkadjust::dna_adjust::v_pseudoMeasCountFwd_
private

◆ v_measurementParams_

◆ v_measurementCount_

◆ v_measurementVarianceCount_

vUINT32 dynadjust::networkadjust::dna_adjust::v_measurementVarianceCount_
private

◆ v_unknownParams_

vUINT32 dynadjust::networkadjust::dna_adjust::v_unknownParams_
private

◆ v_unknownsCount_

◆ v_sigmaZero_

vdouble dynadjust::networkadjust::dna_adjust::v_sigmaZero_
private

◆ v_chiSquaredUpperLimit_

vdouble dynadjust::networkadjust::dna_adjust::v_chiSquaredUpperLimit_
private

◆ v_chiSquaredLowerLimit_

vdouble dynadjust::networkadjust::dna_adjust::v_chiSquaredLowerLimit_
private

◆ v_passFail_

vUINT32 dynadjust::networkadjust::dna_adjust::v_passFail_
private

◆ v_blockStationsMap_

◆ v_blockStationsMapUnique_

◆ v_ISL_

◆ v_JSL_

◆ v_CML_

◆ v_msr_block_

v_uint32_u32u32_pair dynadjust::networkadjust::dna_adjust::v_msr_block_
private

◆ v_msrTally_

vmsrtally dynadjust::networkadjust::dna_adjust::v_msrTally_
private

◆ v_stnmsrTally_

vmsrtally dynadjust::networkadjust::dna_adjust::v_stnmsrTally_
private

Definition at line 1167 of file dnaadjust.hpp.

Referenced by CreateMsrToStnTally(), and PrintMeasurementsToStation().

◆ v_paramStnAppearance_

◆ v_parameterStationCount_

vUINT32 dynadjust::networkadjust::dna_adjust::v_parameterStationCount_
private

◆ v_parameterStationList_

◆ typeBUncertaintyGlobal_

type_b_uncertainty dynadjust::networkadjust::dna_adjust::typeBUncertaintyGlobal_
private

Definition at line 1174 of file dnaadjust.hpp.

Referenced by InitialiseTypeBUncertainties(), and PrintAdjStation().

◆ v_typeBUncertaintiesLocal_

v_type_b_uncertainty dynadjust::networkadjust::dna_adjust::v_typeBUncertaintiesLocal_
private

Definition at line 1177 of file dnaadjust.hpp.

Referenced by InitialiseTypeBUncertainties(), and PrintAdjStation().

◆ v_typeBUncertaintyMethod_

v_type_b_method dynadjust::networkadjust::dna_adjust::v_typeBUncertaintyMethod_
private

Definition at line 1179 of file dnaadjust.hpp.

Referenced by InitialiseTypeBUncertainties(), and PrintAdjStation().

◆ v_stationTypeBMap_

v_uint32_uint32_pair dynadjust::networkadjust::dna_adjust::v_stationTypeBMap_
private

Definition at line 1182 of file dnaadjust.hpp.

Referenced by InitialiseTypeBUncertainties(), and PrintAdjStation().

◆ v_normals_

◆ v_normalsR_

◆ v_AtVinv_

◆ v_design_

◆ v_rigorousVariances_

◆ v_measMinusComp_

◆ v_estimatedStations_

v_mat_2d dynadjust::networkadjust::dna_adjust::v_estimatedStations_
private

◆ v_originalStations_

◆ v_rigorousStations_

◆ v_junctionVariances_

◆ v_junctionVariancesFwd_

◆ v_junctionEstimatesFwd_

◆ v_junctionEstimatesRev_

◆ v_precAdjMsrsFull_

◆ v_corrections_

◆ v_correctionsR_

◆ normals_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::normals_map_
private

Definition at line 1223 of file dnaadjust.hpp.

◆ normalsR_map_

◆ AtVinv_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::AtVinv_map_
private

Definition at line 1225 of file dnaadjust.hpp.

◆ design_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::design_map_
private

Definition at line 1226 of file dnaadjust.hpp.

◆ measMinusComp_map_

◆ estimatedStations_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::estimatedStations_map_
private

◆ originalStations_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::originalStations_map_
private

◆ rigorousStations_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::rigorousStations_map_
private

◆ junctionVariances_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::junctionVariances_map_
private

◆ junctionVariancesFwd_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::junctionVariancesFwd_map_
private

◆ junctionEstimatesFwd_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::junctionEstimatesFwd_map_
private

◆ junctionEstimatesRev_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::junctionEstimatesRev_map_
private

◆ rigorousVariances_map_

vmat_file_map dynadjust::networkadjust::dna_adjust::rigorousVariances_map_
private

◆ precAdjMsrs_map_

◆ corrections_map_

◆ v_stageFileStreams_

vstring dynadjust::networkadjust::dna_adjust::v_stageFileStreams_
private

Definition at line 1239 of file dnaadjust.hpp.

Referenced by OpenStageFileStreams(), and PurgeMatricesFromDisk().

◆ f_normals_

std::fstream dynadjust::networkadjust::dna_adjust::f_normals_
private

Definition at line 1240 of file dnaadjust.hpp.

◆ f_normalsR_

std::fstream dynadjust::networkadjust::dna_adjust::f_normalsR_
private

◆ f_AtVinv_

std::fstream dynadjust::networkadjust::dna_adjust::f_AtVinv_
private

Definition at line 1242 of file dnaadjust.hpp.

◆ f_design_

std::fstream dynadjust::networkadjust::dna_adjust::f_design_
private

Definition at line 1243 of file dnaadjust.hpp.

◆ f_measMinusComp_

std::fstream dynadjust::networkadjust::dna_adjust::f_measMinusComp_
private

◆ f_estimatedStations_

std::fstream dynadjust::networkadjust::dna_adjust::f_estimatedStations_
private

◆ f_originalStations_

std::fstream dynadjust::networkadjust::dna_adjust::f_originalStations_
private

◆ f_rigorousStations_

std::fstream dynadjust::networkadjust::dna_adjust::f_rigorousStations_
private

◆ f_junctionVariances_

std::fstream dynadjust::networkadjust::dna_adjust::f_junctionVariances_
private

◆ f_junctionVariancesFwd_

std::fstream dynadjust::networkadjust::dna_adjust::f_junctionVariancesFwd_
private

◆ f_junctionEstimatesFwd_

std::fstream dynadjust::networkadjust::dna_adjust::f_junctionEstimatesFwd_
private

◆ f_junctionEstimatesRev_

std::fstream dynadjust::networkadjust::dna_adjust::f_junctionEstimatesRev_
private

◆ f_rigorousVariances_

std::fstream dynadjust::networkadjust::dna_adjust::f_rigorousVariances_
private

◆ f_precAdjMsrs_

std::fstream dynadjust::networkadjust::dna_adjust::f_precAdjMsrs_
private

◆ f_corrections_

std::fstream dynadjust::networkadjust::dna_adjust::f_corrections_
private

◆ iterationQueue_

concurrent_queue<UINT32> dynadjust::networkadjust::dna_adjust::iterationQueue_
private

◆ v_designR_

v_mat_2d dynadjust::networkadjust::dna_adjust::v_designR_
private

◆ v_AtVinvR_

◆ v_normalsRC_

v_mat_2d dynadjust::networkadjust::dna_adjust::v_normalsRC_
private

◆ v_measMinusCompR_

◆ v_estimatedStationsR_

◆ v_junctionVariancesR_

v_mat_2d dynadjust::networkadjust::dna_adjust::v_junctionVariancesR_
private

◆ v_blockStationsR

vUINT32 dynadjust::networkadjust::dna_adjust::v_blockStationsR
private

Definition at line 1273 of file dnaadjust.hpp.

◆ v_msr_db_map_

v_msr_database_id_map dynadjust::networkadjust::dna_adjust::v_msr_db_map_
private

◆ _it_dbid

it_vdbid_t dynadjust::networkadjust::dna_adjust::_it_dbid
private

Definition at line 1277 of file dnaadjust.hpp.

Referenced by PrintAdjGNSSAlternateUnits(), and PrintMeasurementDatabaseID().

◆ databaseIDsLoaded_

bool dynadjust::networkadjust::dna_adjust::databaseIDsLoaded_
private

Definition at line 1278 of file dnaadjust.hpp.

Referenced by dna_adjust(), LoadDatabaseId(), and PrintAdjustedNetworkMeasurements().

◆ isCancelled_

std::atomic<bool> dynadjust::networkadjust::dna_adjust::isCancelled_
private

Definition at line 1283 of file dnaadjust.hpp.

Referenced by CancelAdjustment(), dna_adjust(), and IsCancelled().


The documentation for this class was generated from the following files: